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

[Question]: proper whay to advance tasks forward #1

Open
Nedgeva opened this issue Jun 29, 2021 · 3 comments
Open

[Question]: proper whay to advance tasks forward #1

Nedgeva opened this issue Jun 29, 2021 · 3 comments

Comments

@Nedgeva
Copy link

Nedgeva commented Jun 29, 2021

Hey @TylorS ! Thanks for very useful lib 👍
Right now i'm using somewhat a workaround like this

const [timer, scheduler] = createVirtualScheduler();
const advanceTasks = (value = 0) => timer.progressTimeBy(value);

...to propagate tasks (even those that don't have explicit delays).
So i have to call advanceTasks() each time i want to stream to be resolved.
I wonder if there's a batter approach to do that.

@TylorS
Copy link
Member

TylorS commented Jun 29, 2021

Hey, @Nedgeva I'm glad this lib is proving useful for you. To make sure I understand, is it that you don't want to call advanceTasks/progressTimeBy or that you just don't want to have to give them an explicit time period?

@Nedgeva
Copy link
Author

Nedgeva commented Jun 29, 2021

Hey, @Nedgeva I'm glad this lib is proving useful for you. To make sure I understand, is it that you don't want to call advanceTasks/progressTimeBy or that you just don't want to have to give them an explicit time period?

AFAIK calling progressTimeBy is mandatory to make streams runnable (since we're using "virtual" scheduler), so yes is there option to run streams w/o explicitly calling progressTimeBy with 0 value?

@TylorS
Copy link
Member

TylorS commented Jun 29, 2021

Not currently, but I'd be happy to accept a PR to add the default of 0 since it's useful for you

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

2 participants