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

Add ability to pass in an ID and selectively clear tasks #16

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

rwaldron
Copy link
Owner

@rwaldron rwaldron commented Oct 3, 2017

cc @dtex

@dtex
Copy link
Collaborator

dtex commented Oct 4, 2017

I'm still wrapping my head around two things.

  1. Tasks fall off the queue when their key (time) is reached. The task isn't called (or queued again when looping) because isRunnable is false.

  2. Prior to this change the distinction between stop and clear was to remove all listeners on clear and that is still the case. Does it make sense to offer stop by ID as well or maybe even instead of clear by ID?

p.s. Travis is always a jerk to temporal.

@rwaldron
Copy link
Owner Author

rwaldron commented Oct 5, 2017

Tasks fall off the queue when their key (time) is reached. The task isn't called (or queued again when looping) because isRunnable is false.

Yes

Does it make sense to offer stop by ID as well or maybe even instead of clear by ID?

Let's see if that's something that comes up as a need. WDYT?

@dtex
Copy link
Collaborator

dtex commented Oct 5, 2017

Edited to clarify exportable.queue vs internal queue.

So I solidified my understanding of exportable->queue->tasks, what events are bound to each and the lifespan of each... Oh and having exportable.queue and the internal queue really threw me. It all makes sense now.

A user would want to be able to halt a task without (eventually) removing the exportable's busy and idle listeners when the internal queue empties. They may be enqueueing tasks later on in their app and they will expect those listeners to still exist. Removing listeners (eventually) when clearing by ID is not a good thing.

If we are not removing listeners then the behavior more closely matches the existing queue.stop() behavior so we should change it to queue.stop(id).

I'm sorry I put us on the wrong path initially.

@dtex
Copy link
Collaborator

dtex commented Oct 5, 2017

Crap, my whole understanding is flawed. Finally recognizing the difference between the internal queue and instances of Queue changes everything. I think I can do what I wanted to do w/ Temporal as is. Insert long string of curse words here.

@dtex
Copy link
Collaborator

dtex commented Oct 28, 2017

You can close this. It is not necessary.

@dtex
Copy link
Collaborator

dtex commented Nov 10, 2017

Just a reminder to close this. I still have this on another branch, but I really don't think it's necessary and we should close it.

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

Successfully merging this pull request may close these issues.

2 participants