Class StaticMethodModule
Adapter wrapping a static InitRoute.main method as an ITsakModule, in either form of the convention
(): IRouteContext main(IRouteContext) runs through
, Task<IRouteContext> main(IRouteContext) through
. An exception from main reaches the caller as the module threw it, not
wrapped in , so the log and the activation report name the module's
failure. Module name is derived from the namespace of the InitRoute class.
public class StaticMethodModule : ITsakModule, IEmbeddedConfigModule
Inheritance
Implements
Properties
CanInitialize
Whether the module can be initialized (all deps met, no errors).
public bool CanInitialize { get; }
Dependencies
Names of modules this module depends on.
public IReadOnlyList<string> Dependencies { get; }
EmbeddedConfigJson
Raw JSON config from .tpkg package ({moduleName}.config.json), loaded in-memory.
public string? EmbeddedConfigJson { get; }
SourceDirectory
Directory where the module's DLL was loaded from.
public string? SourceDirectory { get; }
Methods
Initialize(IRouteContext)
Runs a synchronous main. An async main is refused: it runs only through .
public IRouteContext Initialize(IRouteContext context)
InitializeAsync(IRouteContext)
Awaits an async main; a synchronous main runs as in .
public Task<IRouteContext> InitializeAsync(IRouteContext context)