Services
Every dependency is represented as a service.
What is a service?
A service is a unit within a larger Jetwhisk app. Any functionality that is not completely functional (or pure) should be encapsulated in a service to allow smarter management.
Instances
But services can't just exist. So on every instantiation, a new instance is created and stored alongside any others. By default, instances are not destroyed until the Orchestrator shuts down, but they can be set to destroy sooner if needed.
The nice thing about the instance system is that you never have to think about the instances themselves. Jetwhisk will just plumb together instances, so all you have to think about is the service layer.
Instance status
Instantiation scopes
Service types
Statuses between types
Ready when...
The called function exits without an error
The service says it is
Active when...
The service is satisfied but not done
Any method is executing
Satisfied when...
When all dependencies are ready
When all dependencies are ready
Failed when...
The called function throws an error
The service either throws an error or fails to instantiate
Done when...
The called function exits without an error
The service says it is
Last updated