Is there any way to list all running services (rpc)?
No, not out of the box.
You can tell fairly easily whether a service is *not* running, because an
RPC request will return an UnknownService error.
···
On Monday, January 15, 2018 at 4:54:39 AM UTC, João Biondo wrote:
Is there any way to list all running services (rpc)?
At first I tried storing state on the service class itself, then I found
out from the docs itself that it spawns a new instance everytime a new call
is made, then
after creating a custom DependencyProvider I thought it worked like a
factory (because of get_dependency()) and a new instance was created
everytime.
Anyways, I know most of this are stated at the docs, but I still think its
valid to have a little diagram of the classes lifecycles.
How everything is connected and how state is managed - from runner to
worker. For example, runners storing containers, containers storing
entrypoints, and more.
···
Em segunda-feira, 15 de janeiro de 2018 02:54:39 UTC-2, João Biondo escreveu:
Is there any way to list all running services (rpc)?
Thats what I thought by searching the code. I ended up making a repository service that asks services for their names each X seconds. Also (offtopic) it would be nice to diagram each class lifecycles somewhere. I struggled with some wrong assumptions
At first I tried storing state on the service class itself, then I found
out from the docs itself that it spawns a new instance everytime a new call
is made, then
after creating a custom DependencyProvider I thought it worked like a
factory (because of get_dependency()) and a new instance was created
everytime.
It is confusing at first that you can't store state on service instance,
because classic OOP in Python uses that paradigm so much.
DependencyProvider.get_dependency() is called for every worker so DPs can
act like factories; equally they can just return something that is
thread-safe and allow it to be shared.
Anyways, I know most of this are stated at the docs, but I still think its
valid to have a little diagram of the classes lifecycles.
How everything is connected and how state is managed - from runner to
worker. For example, runners storing containers, containers storing
entrypoints, and more.
This would be a great addition to the docs. Would love to merge a PR
containing something like this if you had time to create it...
···
On Monday, January 15, 2018 at 10:59:43 AM UTC, João Biondo wrote:
Em segunda-feira, 15 de janeiro de 2018 02:54:39 UTC-2, João Biondo > escreveu:
Is there any way to list all running services (rpc)?
Some docs on class lifecycles would be a welcome addition. What were the
incorrect assumptions? That's probably the best place to start
···
On Monday, January 15, 2018 at 7:00:09 AM UTC, João Biondo wrote:
Thats what I thought by searching the code. I ended up making a repository
service that asks services for their names each X seconds. Also (offtopic)
it would be nice to diagram each class lifecycles somewhere. I struggled
with some wrong assumptions