Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ContextMap ¶
type ContextMap struct {
// contains filtered or unexported fields
}
ContextMap implements a map of call IDs to context cancellation functions.
func (*ContextMap) New ¶
func (ctxMap *ContextMap) New(callID core.CallID) context.Context
New creates a new context associated with the given call ID.
func (*ContextMap) Remove ¶
func (ctxMap *ContextMap) Remove(callID core.CallID)
Remove cancels the context associated with the given call ID and removes it.
type Registry ¶
type Registry struct { Receivers stream.ReceiverMap Contexts ContextMap // contains filtered or unexported fields }
Registry describes a global registry of instances, stop callbacks and contexts.
func (*Registry) RegisterStopFn ¶
func (reg *Registry) RegisterStopFn(instID core.InstanceID, stop func()) core.StopHandle
RegisterStopFn registers a stop callback in relation to the given instance ID and returns a unique stop handle as a reference to said callback. The given instance ID will be used to remove the instance off the registry once the stop callback is called.
func (*Registry) Stop ¶
func (reg *Registry) Stop(handle core.StopHandle)
Stop pops the stop callback with the given handle and calls it. It will also unregister the instance related to the stop callback.