Skip to content
This repository was archived by the owner on Nov 4, 2021. It is now read-only.
This repository was archived by the owner on Nov 4, 2021. It is now read-only.

Add onEvent #328

Description

@mariusandra

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.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions