-
Notifications
You must be signed in to change notification settings - Fork 87
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SynchronizePrimitive class marked private instead of abstract #155
Comments
I just want to flag that However, I think this sounds like a good idea -- it should be possible to set both the |
Hmmm, I see now. The
I thought about this too. I think the actual implementation of |
Yep, so I think that Concerning On the other hand, I think there is merit in considering a complete overhaul of the mutex API for some future Moneta 2.0.0 release. One thing that I find problematic is apps that crash while holding a lock. In such cases, there is no way other than calling the private I also think there should be a facility to have a mutex that uses Moneta's expiry functionality, with the ability to extend the lock, like is done in redlock. The first part can be done at present with the a store that has a a default expiry, but the extending part is not available. |
💯. Suo also does this. I haven't used it but I am currently implementing some "flow control" for background jobs (a la |
I've changed the description of this issue to reflect the documentation problem. We can continue the discussion of overhauling the Mutex API in #156. |
Currently, the public interface for the synchronization primitives is the
#synchronize
method, which is blocking.If using the private interface, one can use
enter(timeout: x, wait: y)
to put an upper bound on lock wait time, or usetry_enter
to avoid blocking altogether.Ideally, these would be exposed in the public interface, such as:
Alternatively, making parts of the internal API part of the public interface would be sufficient (for my purposes). I'm using the private API anyway but it'd be nice to have a stronger compatibility guarantee for my use case, where I want to execute an alternate codepath if the lock is not immediately available.
I don't actually love adding a
block
parameter to synchronize, so maybe this is a different method altogether, liketry_synchronize
?The text was updated successfully, but these errors were encountered: