Init(args)
Scripting Reference
Loading...
Searching...
No Matches

◆ GetAsync< TService >()

static async System.Threading.Tasks.Task< TService > Sisus.Init.Service.GetAsync< TService > ( Context context = Context::MainThread)
static

Gets service of type TService asynchrounously.

The returned service can be a service registered using a ServiceTag or a Services component with availability set to Clients.Everywhere, or a service registered using a ServiceAttribute or manually.

This will suspend the execution of the calling async method until a service of type becomes available.

Template Parameters
TServiceThe defining type of the service.
Parameters
contextInitialization phase during which the method is being called.
Returns
Service of type TService .