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
There's a case to be made for splitting processEvent into processEvent and onEvent. I'm still not 100% convinced introducing a larger API surface is worth it, but the semantics around retries makes it rather appealing.
We would make this distinction:
Plugins which use processEvent modify events and must run in order. For example: adding GeoIP information.
Plugins which use onEvent do not modify the event. They export the processed event to another service or do some other async background processing. For example batching and uploading to S3. All onEvent functions can run in parallel, no sequential ordering needed. We can also run them in parallel with the actual event ingestion code.
This naming scheme onEvent could fit with other "event types" like onAction, onSnapshot (you don't processAction).
Retries are different in both cases. With processEvent, a retry would halt the entire event processing pipeline, and delay event ingestion until a retry passes. With onEvent, a retry would just retry that async background job without ceremony. The event is already ingested.
Hence we might event code retry support for just onEvent for simplicity and leave processEvent out of it.
There's a case to be made for splitting
processEventintoprocessEventandonEvent. I'm still not 100% convinced introducing a larger API surface is worth it, but the semantics around retries makes it rather appealing.We would make this distinction:
processEventmodify events and must run in order. For example: adding GeoIP information.onEventdo not modify the event. They export the processed event to another service or do some other async background processing. For example batching and uploading to S3. AllonEventfunctions can run in parallel, no sequential ordering needed. We can also run them in parallel with the actual event ingestion code.This naming scheme
onEventcould fit with other "event types" likeonAction,onSnapshot(you don'tprocessAction).Retries are different in both cases. With
processEvent, a retry would halt the entire event processing pipeline, and delay event ingestion until a retry passes. WithonEvent, a retry would just retry that async background job without ceremony. The event is already ingested.Hence we might event code retry support for just
onEventfor simplicity and leaveprocessEventout of it.