Module: Kobako::Transport

Defined in:
lib/kobako/transport.rb,
lib/kobako/transport/run.rb,
lib/kobako/transport/error.rb,
lib/kobako/transport/yield.rb,
lib/kobako/transport/request.rb,
lib/kobako/transport/yielder.rb,
lib/kobako/transport/response.rb,
lib/kobako/transport/dispatcher.rb,
sig/kobako/transport.rbs,
sig/kobako/transport/run.rbs,
sig/kobako/transport/error.rbs,
sig/kobako/transport/yield.rbs,
sig/kobako/transport/request.rbs,
sig/kobako/transport/yielder.rbs,
sig/kobako/transport/response.rbs,
sig/kobako/transport/dispatcher.rbs

Overview

See lib/kobako/transport.rb for the umbrella module doc; this file owns the pure-function dispatcher that decodes guest-initiated Requests and produces encoded Responses.

Defined Under Namespace

Modules: Dispatcher, _GuestYielder Classes: Error, Request, Response, Run, Yield, Yielder

Constant Summary collapse

TAG_OK =

First byte of the YieldResponse for the success branch — body is the block's return value encoded as a single msgpack value.

Returns:

  • (Integer)
0x01
TAG_BREAK =

First byte for break val — body is the break value.

Returns:

  • (Integer)
0x02
TAG_RESERVED =

Reserved for future return val support; both sides reject this tag as a wire violation (YieldResponse envelope contract).

Returns:

  • (Integer)
0x03
TAG_ERROR =

First byte for an error / fault outcome — body is a {"class", "message", "backtrace"} Hash.

Returns:

  • (Integer)
0x04
LIVE_TAGS =

Tags both sides currently accept on the wire.

Returns:

  • (Array[Integer])
[TAG_OK, TAG_BREAK, TAG_ERROR].freeze
STATUS_OK =

Response variant marker for the success branch.

Returns:

  • (Integer)
0
STATUS_ERROR =

Response variant marker for the fault branch.

Returns:

  • (Integer)
1