Documentation ¶
Overview ¶
Package fulfiller provides a type that implements capnp.Answer that resolves by calling setter methods.
Index ¶
- type Fulfiller
- func (f *Fulfiller) Done() <-chan struct{}
- func (f *Fulfiller) Fulfill(s capnp.Struct)
- func (f *Fulfiller) Peek() capnp.Answer
- func (f *Fulfiller) PipelineCall(transform []capnp.PipelineOp, call *capnp.Call) capnp.Answer
- func (f *Fulfiller) PipelineClose(transform []capnp.PipelineOp) error
- func (f *Fulfiller) Reject(err error)
- func (f *Fulfiller) Struct() (capnp.Struct, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Fulfiller ¶
type Fulfiller struct {
// contains filtered or unexported fields
}
Fulfiller is a promise for a Struct. The zero value is an unresolved answer. A Fulfiller is considered to be resolved once Fulfill or Reject is called. Calls to the Fulfiller will queue up until it is resolved. A Fulfiller is safe to use from multiple goroutines.
func (*Fulfiller) Done ¶
func (f *Fulfiller) Done() <-chan struct{}
Done returns a channel that is closed once f is resolved.
func (*Fulfiller) Fulfill ¶
func (f *Fulfiller) Fulfill(s capnp.Struct)
Fulfill sets the fulfiller's answer to s. If there are queued pipeline calls, the capabilities on the struct will be embargoed until the queued calls finish. Fulfill will panic if the fulfiller has already been resolved.
func (*Fulfiller) Peek ¶
func (f *Fulfiller) Peek() capnp.Answer
Peek returns f's resolved answer or nil if f has not been resolved. The Struct method of an answer returned from Peek returns immediately.
func (*Fulfiller) PipelineCall ¶
func (f *Fulfiller) PipelineCall(transform []capnp.PipelineOp, call *capnp.Call) capnp.Answer
PipelineCall calls PipelineCall on the fulfilled answer or queues the call if f has not been fulfilled.
func (*Fulfiller) PipelineClose ¶
PipelineClose waits until f is resolved and then calls PipelineClose on the fulfilled answer.