Host class

A program abstraction.

Implemented types
Available extensions

Constructors

Host.new(ServiceProvider services, HostApplicationLifetime applicationLifetime, Logger logger, HostLifetime hostLifetime, Options<HostOptions> options)

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
services ServiceProvider
no setter

Methods

dispose() → void
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
override
disposeAsync() Future<void>
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources asynchronously.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
run([CancellationToken? token]) Future<void>

Available on Host, provided by the HostingAbstractionsHostExtensions extension

Runs an application and returns a Future that only completes when the token is triggered or shutdown is triggered.
runSync() → void

Available on Host, provided by the HostingAbstractionsHostExtensions extension

Runs an application and block the calling thread until host shutdown.
start([CancellationToken? cancellationToken]) Future<void>
Start the program.
startSync() → void

Available on Host, provided by the HostingAbstractionsHostExtensions extension

Starts the host synchronously.
stop([CancellationToken? cancellationToken]) Future<void>
Attempts to gracefully stop the program.
toString() String
A string representation of this object.
inherited
waitForShutdown([CancellationToken? token]) Future<void>

Available on Host, provided by the HostingAbstractionsHostExtensions extension

Returns a Future that completes when shutdown is triggered via the given token.

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Methods

createApplicationBuilder({HostApplicationBuilderSettings? settings}) HostApplicationBuilder
Initializes a new instance of the HostApplicationBuilder class with pre-configured defaults.
createDefaultBuilder() HostBuilder
Initializes a new instance of the HostBuilder class with pre-configured defaults.