Documentation ¶
Index ¶
- type CContainer
- func (c *CContainer) SetValue(val interface{})
- func (c *CContainer) WaitValue(ctx context.Context) (interface{}, error)
- func (c *CContainer) WaitValueChange(ctx context.Context, old interface{}) (interface{}, error)
- func (c *CContainer) WaitValueEmpty(ctx context.Context) error
- func (c *CContainer) WaitValueWithValidator(ctx context.Context, valid func(v interface{}) (bool, error)) (interface{}, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CContainer ¶
type CContainer struct {
// contains filtered or unexported fields
}
CContainer is a concurrent container.
func NewCContainer ¶
func NewCContainer(ctx context.Context, val interface{}) *CContainer
NewCContainer builds a CContainer with a context. Note: context can be nil
func (*CContainer) SetValue ¶
func (c *CContainer) SetValue(val interface{})
SetValue sets the ccontainer value.
Be sure to check for nil when setting if necessary: untyped nil is still considered a set value.
func (*CContainer) WaitValue ¶
func (c *CContainer) WaitValue(ctx context.Context) (interface{}, error)
WaitValue waits for any non-nil value in the container.
func (*CContainer) WaitValueChange ¶
func (c *CContainer) WaitValueChange(ctx context.Context, old interface{}) (interface{}, error)
WaitValueChange waits for a value that is different than the given.
func (*CContainer) WaitValueEmpty ¶
func (c *CContainer) WaitValueEmpty(ctx context.Context) error
WaitValueEmpty waits for a untyped nil value.
func (*CContainer) WaitValueWithValidator ¶
func (c *CContainer) WaitValueWithValidator( ctx context.Context, valid func(v interface{}) (bool, error), ) (interface{}, error)
WaitValueWithValidator waits for any value that matches the validator in the container.
Click to show internal directories.
Click to hide internal directories.