APIRootStarter<A extends APIRoot> class

Helper to gracefully start/stop an APIRoot.

Constructors

APIRootStarter.fromInstance(A apiRoot, {FutureOr<bool> preInitializer()?, FutureOr<bool> stopper()?})
Instantiate from an already defined APIRoot instance.
APIRootStarter.fromInstantiator(A apiRootInstantiator(APIConfig? apiConfig), {FutureOr<APIConfig?> apiConfig()?, FutureOr<bool> preInitializer()?, FutureOr<bool> stopper()?})
Instantiate using instantiator Functions.

Properties

apiRoot → A?
Returns the APIRoot instance if already instantiated. See getAPIRoot.
no setter
hashCode int
The hash code for this object.
no setterinherited
isStarted bool
Returns true if is already started. See start.
no setter
isStopped bool
Returns true if is already stopped. See stop.
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

getAPIRoot() FutureOr<A>
Returns the APIRoot instance. Instantiates it if needed.
getAPIRootStarted() FutureOr<A>
Returns the APIRoot instance started. See getAPIRoot and start.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
start() FutureOr<bool>
Starts the APIRoot instance.
stop() FutureOr<bool>
Stops the APIRoot instance. Calls _stopper if needed. Will return false if is not already started (see isStarted and start).
toString() String
A string representation of this object.
inherited

Operators

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