Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func TestResponseBroker ¶
Types ¶
type ResponseBroker ¶
type ResponseBroker struct {
// contains filtered or unexported fields
}
ResponseBroker propagates a response to an arbitrary number of requests
func New ¶
func New() *ResponseBroker
func (*ResponseBroker) Acquire ¶
func (rb *ResponseBroker) Acquire(identifier string) (handle ResponseHandle, isOwner bool)
func (*ResponseBroker) Done ¶
func (rb *ResponseBroker) Done(identifier string)
Done marks this request identified by `identifier` as finished and waits till anyone who's interested in its response has read it. Should be called after a successful request. Invalidates all ResponseHandles.
type ResponseHandle ¶
type ResponseHandle struct {
// contains filtered or unexported fields
}
ResponseHandle for a request
func (*ResponseHandle) Read ¶
func (h *ResponseHandle) Read() (interface{}, error)
Read reads the response
func (*ResponseHandle) Write ¶
func (h *ResponseHandle) Write(data interface{}, err error)
Write writes a response, letting others read it
Click to show internal directories.
Click to hide internal directories.