-
Notifications
You must be signed in to change notification settings - Fork 11
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
Re-spawning failed actors #40
Comments
There is a Supervision could be integrated more tightly with |
How would one re-spawn the same actor when it dies using during/spawn with #:on-crash? I see the optional argument but I'm not sure how to use that to cause the previously-defined spawn to re-execute itself. |
You would have the (assertion-struct example (x y))
(spawn
(define (actor-body x y)
... endpoints in here ...)
(during/spawn (example $x $y)
#:on-crash (spawn (actor-body x y))
(actor-body x y)))) It looks like this could be pretty straightforward to add as a macro if it seems useful enough. |
Ok nice, thanks! I wasn't sure if the lexical context was important with these clauses. Good to know that the actions can be pulled out into their own function. I agree that a macro would be nice! |
Is there a recommended pattern to concisely re-spawn failed actors? The dissertation suggests potential tools to use to notice dead actors like a retraction of an advertisement but it's unclear to me how to retry the failed operation in those cases without code duplication (especially in the case of something like
during/spawn
)The text was updated successfully, but these errors were encountered: