massenz / go-statemachine

A basic implementation of a Finite State Machine in Go

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Add metadata to Events

massenz opened this issue · comments

In general, we expect Events (if carrying information of interest) to be stored elsewhere in the system, with the EventId acting as the "bridge" to retrieve them, as necessary.

However, under certain circumstances, Statemachine's users may not want to use a separate store for events' metadata; there are currently two possible options:

  1. we store the metadata as bytes alongside the Event in the FSM's History;
  2. we store the Event separately as an entity in Redis, and we use the event_id from the FSM's `history' to retrieve the associated Event data.

There are pros/cons to both approaches and they should be both considered before making a decision.

This has been done in Release 0.5.0 of the protos which are now being used in the upcoming release 0.5.0 of statemachine