eventing
eventing copied to clipboard
Support `one-offs` for firing events only once
Problem
As a user I want to fire (schedule) an action (alarm/script) or event once at a particular time. This can be done by emitting an event "once" (ignoring distr. sys challenges for a second) with customizable data
at a particular point in time.
cc/ @lionelvillard
Links:
- https://twitter.com/embano1/status/1511613644777439234?s=20&t=XN6gjYCX3lXsFWLAaKp-Hg
- https://knative.slack.com/archives/C9JP909F0/p1649248557443529?thread_ts=1649234703.449399&cid=C9JP909F0
Persona: Developers, DevOps, operators
Exit Criteria A Knative resource which lets a user fire an event once at a particular time.
- Specify
data
for event which should be fired - Specify
start
(optionallyend
) timeframe for which the event should be valid (TTL?)
Time Estimate (optional): 1 week.
Additional context (optional)
Evaluated but not meeting exit criteria:
- Knative
PingSource
: followscron
pattern, i.e. recurring schedule and not "only once" - Kubernetes
Job
withsuspension
which requires a custom controller (logic) and has not simple UX in my opinion (also is not event-oriented)
This issue is stale because it has been open for 90 days with no
activity. It will automatically close after 30 more days of
inactivity. Reopen the issue with /reopen
. Mark the issue as
fresh by adding the comment /remove-lifecycle stale
.
@lionelvillard what do you think?
/remove-lifecycle stale
this is a very useful feature.
@lionelvillard I made a simple analysis and came up with a few questions. Would you like to share your opinion?
If we want to implement such an event with a dedicated adapter e.g. "onceadapter" in knative/eventing
, there will be a lot duplicated codes similar as pingsource adapter. If we don't want duplicated code, we can just leverage "pingsource" adapter and extend it to support "one-off" event. We introduce a new Runner "oneOffJobRunner" similar as "cronJobsRunner". Then we will use the same event type "PingSource" to support the one-off event.
Another choice is to introduce a new event type in knative-sandbox with a separated repo. Then it will be a new event type and will include the whole structure of a new event source.
Which one do you prefer?
@daisy-ycguo I'm also thinking of extending the current PingSource to support firing events only once. We need to:
- extend the PingSource API with a new
date
field (similar to OpenWhisk Alarms) - introduce a new Runner.
So +1 on your proposal!
/assign
Should we also think about some form of garbage collection for one-off pings?
It seems like the right time to discuss this since it could be the default behavior of a one-off ping source.
Sorry I dont have time to work on it recently. /unassign
/assign