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

Spawning a cluster of actors #242

Closed
xdb64 opened this issue Oct 5, 2021 · 3 comments
Closed

Spawning a cluster of actors #242

xdb64 opened this issue Oct 5, 2021 · 3 comments

Comments

@xdb64
Copy link

xdb64 commented Oct 5, 2021

I'm using tractor with my TCP SYN port scanner and I'm amazed by its smooth integration with trio, as well as the performance I've managed to squeeze out of my computer using these great libs.

During the development, I've come across the need to spawn a cluster of actors, open contexts on all of them, and then open streams on those. Currently, I have to hard-code everything (one spawn-context-stream triplet per actor) which results in a big async with block. I wish there was a handy utility procedure that would spawn n actors, open contexts on all of them, and finally, open streams - thus allowing for a number of streams proportional to the number of CPU cores to be created, for example. I'm sure what I'm asking is too specific, but I am also sure that these peculiarities could be abstracted away in a couple of generalized utility routines for doing similar tasks.

I know some of this is on its way, but in any case, please let me know once it's ready; I'd be happy to assist with battle-testing.

@goodboy
Copy link
Owner

goodboy commented Oct 5, 2021

I'm amazed by its smooth integration with trio, as well as the performance I've managed to squeeze out of my computer using these great libs.

😎

@adder46 thanks for the issue friend.

I'm hoping we can get you what you need in #241 and ideally get some decent teardown latency going as well.

As mentioned in chat, the Context.open_stream() only really benefits from concurrency on __aexit__() (since it'll send a 'stop' msg on close) so we'll need to target maybe even avoiding that bit if we want some kind of hard shutdown of streams.

goodboy added a commit that referenced this issue Oct 22, 2021
@goodboy
Copy link
Owner

goodboy commented Dec 20, 2021

I think we added this in #241 yah?

@goodboy
Copy link
Owner

goodboy commented Dec 20, 2021

Closed via #241.

@goodboy goodboy closed this as completed Dec 20, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants