-
Notifications
You must be signed in to change notification settings - Fork 22
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feature: concrete handles to specific requested instances when a cluster of instances is created #560
Comments
I would rather have:
And here, I would prefer So putting this together, it would be:
|
I agree. In any case, there is no need to return a tuple if it can be accessed using the
As - cluster.stop_instance(instance_0)
+ instance_0.stop() |
CURRENT STATE:
|
Main interface change: when running services in a Cluster, spawned `Service` instances are immediately available. Main internal changes: * `yapapi.services` split to separate files * `yapapi.services.Cluster` split to `ServiceRunner` and a `Cluster` Additional interface changes: * `Service.reset()` - method called when a service is restarted, this was added because now handlers of restarted instances are called more then once * One can use the `ServiceRunner` directly, e.g. via `cluster.service_runner.add_instance()`, although this is not documented. resolves #560
the most important pain point is that when a cluster is created and/or new instances are added to an existing cluster, the instances of the Service class are not created until the activities are started -> this makes it cumbersome for the client code to identify specific instances added for each request -> and the requirement here is that each newly-created instance or set of instances should be easily attributable to the specific
Golem.run_service
/Cluster.spawn_instances
callsone suggested solution is that:
pending
)run_service
returns a tuple ofCluster
+ list of instancesspawn_instances
returns the list of instances ...CAVEAT
Service
inside theServiceInstance
? makeServiceInstance
available to the external code and making the aforementioned replacement explicit (e.g. in that, the client code should always retrieve the instance of aService
through some property/helper method ofServiceInstance
?) ... ... maybeServiceInstance
could serve a role similar to what a ServiceWrapper currently does in yapapi-service-manager?possibly also connected: #544
The text was updated successfully, but these errors were encountered: