Documentation ¶
Overview ¶
Package server provides runtime support for implementing Cap'n Proto interfaces locally.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Ack ¶
func Ack(opts capnp.CallOptions)
Ack acknowledges delivery of a server call, allowing other methods to be called on the server. It is intended to be used inside the implementation of a server function. Calling Ack on options that aren't from a server method implementation is a no-op.
Example:
func (my *myServer) MyMethod(call schema.MyServer_myMethod) error { server.Ack(call.Options) // ... do long-running operation ... return nil }
Ack need not be the first call in a function nor is it required. Since the function's return is also an acknowledgment of delivery, short functions can return without calling Ack. However, since clients will not return an Answer until the delivery is acknowledged, it is advisable to ack early.
Types ¶
type Closer ¶
type Closer interface {
Close() error
}
Closer is the interface that wraps the Close method.