Documentation
¶
Overview ¶
Package contextmanager simulates multiple-parent contexts with sticky cancellation.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Manager ¶
Manager tracks contexts derived from the root context.
func (*Manager[K]) Cancel ¶
Cancel cancels the context for the given key with reason. If no context exists for the key a context will be created and cancelled.
func (*Manager[K]) Context ¶
Context returns a new context that is derived from parent. The context will be cancelled if either the manager's root context or the respective key context is cancelled.
func (*Manager[K]) Delete ¶
Delete removes the entry for the given key, cancelling its context with reason.
func (*Manager[K]) IsCancelled ¶ added in v0.34.0
IsCancelled reports whether an entry exists for the given key and its context has been cancelled. It does not create an entry.