-
Notifications
You must be signed in to change notification settings - Fork 60
Add chapter on arbiters, with example of using these to process async events #22
Conversation
actix/src/sec-5-arbiter.md
Outdated
|
||
As a result Arbiters perform a number of function. Most notably, they are able | ||
to spawn a new OS thread, run an event loop, execute functions asynchronously |
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.
execute functions asynchronously
I think it would be better to say spawn asynchronous tasks
since execute
may imply blocking and there is no utility for that
As actual tasks are executed by event loop
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.
Changed,
|
||
fn main() { | ||
let system = System::new("test"); |
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.
It might be worthwhile to add that System
actually has own arbiter and therefore in this example you spawn task on System's arbiter
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.
Yes, this is a good point.
actix/src/sec-5-arbiter.md
Outdated
``` | ||
|
||
## Why can't I create my own? |
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.
is this section necessary?
I'm not sure what is intention here
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.
Because I wanted to add a section on "how to make extra arbiters and assign actors to them", but it seems quite ... uhh, difficult to achieve, and the api is changing a lot between the current version and the next actix version I think.
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.
I don't think user is supposed to create own arbiter at all?
That's why I'm not sure if this section is needed
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.
Hmmm okay. I'll remove this part.
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.
Thanks
No description provided.