-
Notifications
You must be signed in to change notification settings - Fork 12
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
Clusters and hot tips #260
Conversation
@@ -38,7 +38,7 @@ async def open_actor_cluster( | |||
uid = tractor.current_actor().uid | |||
|
|||
async def _start(name: str) -> None: | |||
name = f'{name}.{uid}' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looked super horrible/confusing if you actually printed it 😂
docs/README.rst
Outdated
|
||
for (name, portal) in portal_map.items(): | ||
n.start_soon( | ||
partial( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just realizing i guess we don't actually need the partial
right?
examples/quick_cluster.py
Outdated
|
||
for (name, portal) in portal_map.items(): | ||
n.start_soon( | ||
partial( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yah, I had the partial()
originally because I thought we needed to pass a name='blah'
kwarg but we're actually auto-generating them unless a sequence is passed.
I'm wondering if we should tweak this api to allow passing in only the names: list[str]
and if so then the helper makes only as many actors as there are names? Also, in the case where names
is passed we probably shouldn't be doing this <parentname>.<childname>
generation right?
Adds an example and mirrors it in the readme.
I tweaked the auto-generated names for actors created with
open_actor_cluster()
to be simpler (since they had this weird.uid
string thing going on) to be simply<parent_name>.<name>
.Oh right, and started a little internal dev tips doc just for reminding myself of stuff.
It needs lots more content don't worry.