Documentation
¶
Overview ¶
The handler package allows managing Kappa handlers, an abstraction on top of serverless handlers.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func EncodeCoordCallResult ¶
Types ¶
type CCResT ¶
type CCResT interface{} // Return type of coordinator calls.
TODO(zhangwen): using interface{} liberally is worrisome.
type CoordCall ¶
type CoordCall struct {
Seqno SeqnoT `json:"seqno"`
Op string `json:"op"`
Params easyjson.RawMessage `json:"params"`
}
CoordCall is the format of a single coordinator call inside a request to the coordinator.
func (CoordCall) MarshalEasyJSON ¶
MarshalEasyJSON supports easyjson.Marshaler interface
func (CoordCall) MarshalJSON ¶
MarshalJSON supports json.Marshaler interface
func (*CoordCall) UnmarshalEasyJSON ¶
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*CoordCall) UnmarshalJSON ¶
UnmarshalJSON supports json.Unmarshaler interface
type CrashedError ¶
type CrashedError struct {
ErrorMessage string
}
CrashedError is returned when a handler has crashed (e.g., due to an uncaught exception).
func (*CrashedError) Error ¶
func (e *CrashedError) Error() string
type Handler ¶
type Handler interface {
// Returns a channel to read the invocation result from; the channel is closed after the result is written to it.
InvokeAsync(pid PidT, seqno SeqnoT, chkID string, ccRes CCResT, appEv AppEvT, target InvokeTarget) <-chan InvokeRet
// Finalize cleans up allocated resources. Any error encountered during cleanup is logged but ignored.
Finalize()
}
type Request ¶
type Request struct {
Pid PidT `json:"pid"`
Seqno SeqnoT `json:"seqno"`
ChkID string `json:"chk_id"`
Calls []CoordCall `json:"calls"`
Blocked bool `json:"blocked"`
Err *string `json:"err"`
}
Request is the format of a handler's request to the coordinator.
func ParseRequest ¶
func (Request) MarshalEasyJSON ¶
MarshalEasyJSON supports easyjson.Marshaler interface
func (Request) MarshalJSON ¶
MarshalJSON supports json.Marshaler interface
func (*Request) UnmarshalEasyJSON ¶
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*Request) UnmarshalJSON ¶
UnmarshalJSON supports json.Unmarshaler interface
type TimeoutError ¶
type TimeoutError struct{}
TimeoutError is returned when a handler has been killed by timeout.
func (*TimeoutError) Error ¶
func (*TimeoutError) Error() string