canjs / can-queues

A light weight JavaScript task queue
https://canjs.com/doc/can-queues.html
MIT License
2 stars 2 forks source link

add stopAfterTaskCount and breakOnTaskName #27

Open justinbmeyer opened 5 years ago

justinbmeyer commented 5 years ago

For #24

This isn't ready yet. It needs review and some documentation.

This adds 3 things:

stopAfterTaskCount

Allows you to specify how many total tasks should be allowed to run. For example:

queues.stopAfterTaskCount(100)

This is useful for debugging because it will prevent stack overflows.

breakOnTaskName

Allows you to break on a particular task:

queues.breakOnTaskName("Observation<ScopeKeyData{{state}}.read>.onDependencyChange")

"click on this to break" getter

On tasks, I added a getter that when clicked, will hit a debugger the next time that function is executed or queued.

Considerations