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

SyncArbiters can close with active messages in queue #398

Open
Firstyear opened this issue Jun 1, 2020 · 0 comments
Open

SyncArbiters can close with active messages in queue #398

Firstyear opened this issue Jun 1, 2020 · 0 comments

Comments

@Firstyear
Copy link
Contributor

Expected Behavior

SyncArbiters can close where there are active messages in their queues. Normally this behaviour is fine, but for example, a syncarbiter acting as a logging thread, this can cause information to be lost.

Current Behavior

In the context, it should be possible to specify the stop conditions, such as "just stop" or "stop once drained" for example. Normally stop order comes from the msg.connected(), which means that once there are no more connections, it should be possible to drain the queue, and exit the arbiter cleanly.

  • Actix Version: 0.9, but examining the code, this would occur in 1.0.0

I think this could be achieved simply by adding a "is_empty()" to msgs, which returns "state.num_messages == 0", then in sync.rs, the stop condition would be "if connected || !is_empty()"

I can supply a patch if needed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant