Closed AndreasWurm closed 8 years ago
I would like Stoplight to be thread safe, but I don't have a lot of experience with thread safety in Ruby. If I understand you correctly, we would have to do at least two things to make Stoplight thread safe:
Stoplight::Light
. Is that correct?
First off, a bit of clarification why we should care about threadsafety. Its not only about writing concurrent code ourselfs but another important usecase is using threaded libraries or frameworks for example just using Rails in a threaded server, like Puma or Phusion Passenger with PassengerConcurrencyModel thread
.
I'll give it a shot during the next week and come back to you with a suggested implementation.
Ok great! I will be happy to review a pull request. Let me know if I can help.
Any movement on this?
sorry mate havnt found the time yet, this weekend is also pretty stuffed, give me till next friday
No rush.
Did #92 close this, or is there more to do?
think its fine :thumbsup:
Great, thanks!
Hey,
Stoplight with MemoryStore is not threadsafe. It would be awsome if stoplight would be usable in threaded ruby code. The only shared state between Stoplights seems to be the class variables in Stoplight::Light and the DataStore.