Skip to content
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

Merged
merged 5 commits into from
Nov 4, 2021
Merged

Clusters and hot tips #260

merged 5 commits into from
Nov 4, 2021

Conversation

goodboy
Copy link
Owner

@goodboy goodboy commented Nov 2, 2021

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.

@@ -38,7 +38,7 @@ async def open_actor_cluster(
uid = tractor.current_actor().uid

async def _start(name: str) -> None:
name = f'{name}.{uid}'
Copy link
Owner Author

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(
Copy link
Owner Author

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?


for (name, portal) in portal_map.items():
n.start_soon(
partial(
Copy link
Owner Author

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?

@goodboy goodboy merged commit 08fa55a into master Nov 4, 2021
@goodboy goodboy deleted the clusters_and_hot_tips branch November 4, 2021 16:02
@goodboy goodboy mentioned this pull request Jan 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants