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

Built-in timers/intervals #14

Closed
mcginty opened this issue Feb 19, 2021 · 6 comments · Fixed by #58
Closed

Built-in timers/intervals #14

mcginty opened this issue Feb 19, 2021 · 6 comments · Fixed by #58
Labels
enhancement New feature or request

Comments

@mcginty
Copy link
Collaborator

mcginty commented Feb 19, 2021

Do we want??

@strohel strohel added the enhancement New feature or request label Feb 20, 2021
@strohel
Copy link
Member

strohel commented Feb 21, 2021

Would this mean something more involved than thread::sleep()? Perhaps interruptible sleep, perhaps by the control channel/shutdown? (the interruptible sleep sounds a bit like async runtime though)

@bschwind
Copy link
Member

I think it mostly means being able to run actors at a repeated interval (to rephrase, send them messages at a fixed interval), or send a message after a specified timeout without blocking any threads. Async runtimes would definitely be helpful here.

@mcginty
Copy link
Collaborator Author

mcginty commented Feb 22, 2021

Async runtimes basically just run a separate timer thread that usually uses the Timing Wheels architecture.

See: https://docs.rs/tokio-timer/0.2.13/tokio_timer/timer/struct.Timer.html

I guess it would be a matter of us deciding if we wanted to (possibly behind a feature flag) implement or import a timer thread that could send messages at delays or intervals.

@bschwind
Copy link
Member

bschwind commented Apr 27, 2021

@bschwind
Copy link
Member

A simple, naive implementation has been implemented in #52 but I'd like to eventually replace that implementation with #53 after settling on a user-facing API.

@strohel strohel changed the title Built-in timers/intervals? Built-in timers/intervals May 12, 2021
strohel added a commit that referenced this issue May 17, 2021
This reverts commit 6495dbb, as planned in
#14 (comment)

Note that this also reverts the version bump from 0.4.1 to 0.5.0. That will
be fixed in the next commit.
strohel added a commit that referenced this issue May 20, 2021
This reverts commit 6495dbb, as planned in
#14 (comment)

Note that this also reverts the version bump from 0.4.1 to 0.5.0. That will
be fixed in the next commit.
@strohel
Copy link
Member

strohel commented May 20, 2021

#53 has been merged, but per comments therein we still want to introduce a helper actor + an ergonomic API on top of it. I'll open a PR to iterate that.

strohel added a commit that referenced this issue Jul 13, 2021
See module level docs and `delay_actor.rs` example for info.

Closes #14.

Builds on the fact that actors can now customize their context.
strohel added a commit that referenced this issue Jul 13, 2021
See module level docs and `delay_actor.rs` example for info.

Closes #14.

Builds on the fact that actors can now customize their context.
strohel added a commit that referenced this issue Jul 14, 2021
See module level docs and `delay_actor.rs` example for info.

Closes #14.

Builds on the fact that actors can now customize their context.
strohel added a commit that referenced this issue Jul 14, 2021
See module level docs and `delay_actor.rs` example for info.

Closes #14.

Builds on the fact that actors can now customize their context.

v2: implement Deref, take factory instead of requiring Clone.
strohel added a commit that referenced this issue Jul 26, 2021
See module level docs and `delay_actor.rs` example for info.

Closes #14.

Builds on the fact that actors can now customize their context.

v2: implement Deref, take factory instead of requiring Clone.
strohel added a commit that referenced this issue Jul 26, 2021
See module level docs and `delay_actor.rs` example for info.

Closes #14.

Builds on the fact that actors can now customize their context.

v2: implement Deref, take factory instead of requiring Clone.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants