simplesourcing / simplesagas

Simple Sagas is a library for building process coordinators for distributed systems based on Kafka Streams
Apache License 2.0
20 stars 5 forks source link

Blocking lock on saga item #23

Open szoio opened 5 years ago

szoio commented 5 years ago

Access to a resource can be synchronised through a simple sourcing semaphore aggregate, simply a boolean value keyed by the resource key, with the value indicating whether a the resource is available or not. If the resource is available it claims it, otherwise it has no option but to fast fail the saga. Would something like this be useful:? Instead of fast failing the saga, it waits for the resource to be available. Essentially a saga action that implements a lock on a resource, such that the saga can only proceed when the lock becomes available. Access is granted to the resource one-at-a-time on a first-come-first-served basis. OR: Would adding this encourage using sagas in a way where low throughput patterns are too easily supported.