Skip to content
This repository has been archived by the owner on May 9, 2019. It is now read-only.

Use a Cluster Singleton for the AuctionScheduler #27

Open
TimMoore opened this issue Feb 17, 2017 · 3 comments
Open

Use a Cluster Singleton for the AuctionScheduler #27

TimMoore opened this issue Feb 17, 2017 · 3 comments

Comments

@TimMoore
Copy link
Contributor

AuctionScheduler is not cluster aware: it will run its scheduled task on all nodes.

We should demonstrate use of a cluster singleton to ensure it only runs on one node.

(We should port this change to Scala as well.)

@jroper
Copy link
Member

jroper commented Feb 20, 2017

Technically there's no problem with this, the worst that will happen is that duplicate commands get sent to end the auction, but the auction entity is tolerant to this.

@TimMoore
Copy link
Contributor Author

I agree that it isn't important in this specific case, but since this is the go-to example for scheduled tasks, and since many use cases will require a cluster singleton, I still think it's worth doing here as an example for others.

@jroper
Copy link
Member

jroper commented Feb 21, 2017

For that we should probably provide an abstraction in Lagom, perhaps offering the ability to schedule something once on every node, to schedule something as a cluster singleton, and to distribute a list of scheduled tasks across all the nodes.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Development

No branches or pull requests

4 participants