You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is a proposal. I am not sure yet I want to include that. I am concerned that it could change the nature of processors from a simple "function" to something event-based. There are definitely places where I could see abusing the event thing, notably in node.js applications where running a loop is less practical.
The manager will emit events to processors on various occasions. Processors which implement the on method will receive each event emitted by the manager, and then do whatever they want with it. Processors which do not implement the on method will simply be skipped.
The on method accepts 2 arguments, the first one is a string identifying the event, and the second is an object containing data associated with the event. For example:
Events COMPONENT_CREATED and COMPONENT_UPDATED are now sent to processors, thanks to @maxailloud in #37. Keeping this open to remember to add COMPONENT_REMOVED eventually.
Based on @CodestarGames' proposition in #21.
This is a proposal. I am not sure yet I want to include that. I am concerned that it could change the nature of processors from a simple "function" to something event-based. There are definitely places where I could see abusing the event thing, notably in node.js applications where running a loop is less practical.
The manager will emit events to processors on various occasions. Processors which implement the
on
method will receive each event emitted by the manager, and then do whatever they want with it. Processors which do not implement theon
method will simply be skipped.The
on
method accepts 2 arguments, the first one is a string identifying the event, and the second is an object containing data associated with the event. For example:For a start, events will be:
COMPONENT_CREATED
COMPONENT_REMOVED
COMPONENT_STATE_UPDATED
The data sent along with each event will be:
Here's what a Processor using that could look like:
The text was updated successfully, but these errors were encountered: