Skip to content
This repository has been archived by the owner on Jun 15, 2024. It is now read-only.

Trigger events after pipeline-state has processed an update #136

Closed
flosell opened this issue Oct 16, 2016 · 2 comments
Closed

Trigger events after pipeline-state has processed an update #136

flosell opened this issue Oct 16, 2016 · 2 comments

Comments

@flosell
Copy link
Owner

flosell commented Oct 16, 2016

Problem

Extensions like LambdaUI want to send updates about the build state (in this case via Websocket) to their clients whenever something changes.

At the moment, they can listen e.g. for :step-result-updated but (because event-bus listeners don't have an order) can't be sure that this event has already been processed by the pipeline-state component, i.e. that they'll actually find the new state when asking the pipeline-state component.

Example: I want to assemble a build history after I received an event that indicates that a pipeline-run is completed. When I receive this event, I need to ask the pipeline-state component for the current state to assemble history information. But I can't be sure that I actually get the new history because it might not have processed the same event I received yet.

Potential Solutions

Extensions needing this information track their own state based on existing events

Pro:
* No additional APIs needed from lambdacd-core
* Their state can be custom-tailored for their use-case

Con:
* Additional effort for extension-developers
* Hard to get right, especially when data has to be loaded from persistence and not from events that occurred during the runtime of the current process

Introduce events that are triggered once the persistence component processed the event

Pro:

  • Minimal effort for extension-developers

Con:

  • Additional API
  • Potentially confusing to developers (:step-result-updated or :step-result-update-persisted???)

Context

Related issues

@flosell
Copy link
Owner Author

flosell commented Oct 16, 2016

CC @sroidl

flosell added a commit that referenced this issue Oct 23, 2016
@flosell
Copy link
Owner Author

flosell commented Oct 23, 2016

Done and documented in wiki

@flosell flosell closed this as completed Oct 23, 2016
flosell added a commit that referenced this issue Feb 5, 2017
flosell added a commit that referenced this issue Feb 5, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant