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

Priority Queues #4

Open
draggett opened this issue Jun 3, 2020 · 1 comment
Open

Priority Queues #4

draggett opened this issue Jun 3, 2020 · 1 comment

Comments

@draggett
Copy link
Member

draggett commented Jun 3, 2020

In a real-time environment, events can be notified by setting the goal module's buffer. If two processes independently set the goal buffer in a very short time interval, the first event will be overwritten before the rule engine has a chance to respond to it. To avoid this, the rule engine supports a priority queue for module buffers. Chunks can be pushed to the queue and are placed in the queue according to their priority. The priority is not exposed in the rule language. The rule engine pops the queue after executing a rule provided that none of the actions in that rule explicitly updated the buffer. In the JavaScript library (chunks.js) the priority is an integer in the range 1 to 10 with 1 as the lowest priority and 10 the highest.

@draggett
Copy link
Member Author

draggett commented Jun 6, 2020

You can clear the module's buffer with "@Do clear" or pop its queue with "@Do pop". A further option is to undefine a property of the module's buffer with "@undefine foo" for property foo. This has no effect if that property is already undefined. Note @Do should have a lower case "D" but GitHub is rendering this incorrectly.

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