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

the Stream for AsyncRunner doesn't consume the write queue #197

Open
museun opened this issue Sep 9, 2020 · 2 comments
Open

the Stream for AsyncRunner doesn't consume the write queue #197

museun opened this issue Sep 9, 2020 · 2 comments
Labels
bug Something isn't working

Comments

@museun
Copy link
Owner

museun commented Sep 9, 2020

This is a problem and its because the Stream isn't constantly being polled. We either need to remove the Stream interface or provide another future people can poll to drive the queue.

Also side note, the rate limiter is overly complex and shouldn't be a concern of this crate.

@museun museun added the bug Something isn't working label Sep 9, 2020
@museun
Copy link
Owner Author

museun commented Sep 9, 2020

To explain further when using the AsyncRunner as a Stream messages won't be written until it reads a message.

@ianbrickbod
Copy link

ianbrickbod commented Sep 25, 2021

to combat this I've got the slightly dodgy code of:

twitch::say(&mut r,selection).await;
let start = SystemTime::now();
while SystemTime::now().duration_since(start).unwrap() < Duration::from_millis(100){
   r.step().await;
}

At some point I'm going to get tripped up due to latency or something meaning the 100ms is not going to be long enough, but for now it seems ok

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants