waitingq

package
v0.1.10 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 17, 2024 License: ISC Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type WaitingReplyQueue

type WaitingReplyQueue struct {
	sync.Mutex
	// contains filtered or unexported fields
}

waitingReplyQueue abstracts a queue where requests on multiple goroutines must be made one at a time to a backing service because replies must be received in order.

A new initialized value is ready for use and must not be copied. Note that passing different contexts to the different functions may result in memory leaks.

func (*WaitingReplyQueue) ReplyLastSend

func (wq *WaitingReplyQueue) ReplyLastSend(ctx context.Context, v interface{}) error

ReplyLastSend pushes the reply to the last unblocked send. It returns an error if there are no callers waiting for a reply.

func (*WaitingReplyQueue) WaitForReadyToSend

func (wq *WaitingReplyQueue) WaitForReadyToSend(ctx context.Context) chan interface{}

waitForReadyToSend returns nil if the context is canceled or a chan where the next reply of this waiting queue will be received.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL