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
Add array of observers to queue. When events like a job is added, finished, failed occur these observers are informed. This allows us to separate out non-core job handling code into individual observers. eg
publishing events to service eg mqtt, rabbitmq, AWS SQS
schedule new jobs based on jobs finishing
If we define an observer protocol there are two ways we can define this
A protocol that includes methods for every event
A protocol that has one function onEvent which is provided with a event type (with additional metadata)
2 has the advantages of being more flexible than 1 but it might have performance issues as every observer would have to get the event type before working out what to do with it.
Add array of observers to queue. When events like a job is added, finished, failed occur these observers are informed. This allows us to separate out non-core job handling code into individual observers. eg
publishing events to service eg mqtt, rabbitmq, AWS SQS
schedule new jobs based on jobs finishing
If we define an observer protocol there are two ways we can define this
A protocol that includes methods for every event
A protocol that has one function onEvent which is provided with a event type (with additional metadata)
2 has the advantages of being more flexible than 1 but it might have performance issues as every observer would have to get the event type before working out what to do with it.
I agree with defining a protocol which includes a method for every event is more performant. What's the actual cost of the send options? Since every job would already have all possible observers by default?
Add array of observers to queue. When events like a job is added, finished, failed occur these observers are informed. This allows us to separate out non-core job handling code into individual observers. eg
If we define an observer protocol there are two ways we can define this
onEvent
which is provided with a event type (with additional metadata)2 has the advantages of being more flexible than 1 but it might have performance issues as every observer would have to get the event type before working out what to do with it.
@Joannis @thoven87
The text was updated successfully, but these errors were encountered: