Not a drop-in replacement, but there is net/textproto.Pipeline
<https://pkg.go.dev/net/textproto#Pipeline>. (intended for sequencing
text-based network protocols going over a socket, but it's not too far off)

You'd call `Next()` to grab the sequence-handle and then
call `p.StartRequest(id)` to grab the lock. Unlocking would be
`p.EndRequest(id)`.
I think you can ignore the response-side for this use-case, but I'm not
certain.

On Fri, Sep 9, 2022 at 3:12 PM ChrisLu <chris...@gmail.com> wrote:

> "sync.Mutex" is not FIFO. Has any package implemented a dropping for FIFO
> mutex?
>
> One similar solution is to use buffered channel, but it is limited by the
> buffer size, and requires non-trivial re-architecturing.
>
> Chris
>
> --
> You received this message because you are subscribed to the Google Groups
> "golang-nuts" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to golang-nuts+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/golang-nuts/f4772670-65d8-4b31-a71a-d01ad20214ebn%40googlegroups.com
> <https://groups.google.com/d/msgid/golang-nuts/f4772670-65d8-4b31-a71a-d01ad20214ebn%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/CANrC0BhtxnmU%2B71h_GCph50fCBo5GxCiAJSvrt07JjcFiSMiSw%40mail.gmail.com.

Reply via email to