Documentation
¶
Overview ¶
Package workerbridge adapts the frozen legacy worker WebSocket client to the public workerkit.Wire port, so the shipped products (human local, human worker) can run the web human side against the existing gateway while the caller half of dual-stack convergence is still pending.
The bridge is deliberately thin and deterministic:
- Legacy assignments have no transport delivery ID; the bridge derives a stable one from the caller/idempotency identity, so gateway redelivery after reconnect deduplicates inside workerkit.
- The legacy dialect has no assignment ACK; ConfirmAssignment is a no-op and the gateway's redelivery-on-reconnect remains the recovery path.
- SendEvent binds the event to the remembered legacy assignment and the durable workerclient outbox; the outbox, not workerkit, owns replay.
- Rejections surface the legacy NACK inbox; ConfirmRejection maps to the durable ConfirmRejectedEvent keyed by the bridged delivery ID, which the bridge sets to the rejected event ID.
Index ¶
- type Bridge
- func (bridge *Bridge) Assignments() <-chan llm.WorkerAssignmentDelivery
- func (bridge *Bridge) Close() error
- func (bridge *Bridge) ConfirmAssignment(ctx context.Context, id llm.WorkerDeliveryID) error
- func (bridge *Bridge) ConfirmRejection(ctx context.Context, id llm.WorkerDeliveryID) error
- func (bridge *Bridge) Done() <-chan struct{}
- func (bridge *Bridge) Err() error
- func (bridge *Bridge) Notices() <-chan workerkit.Notice
- func (bridge *Bridge) Rejections() <-chan workerkit.Rejection
- func (bridge *Bridge) SendEvent(ctx context.Context, delivery llm.WorkerEventDelivery) error
- type Config
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Bridge ¶
type Bridge struct {
// contains filtered or unexported fields
}
Bridge implements workerkit.Wire over the legacy worker WebSocket dialect.
func Dial ¶
Dial connects the legacy worker client and starts the conversion pump. ctx bounds construction only; Close owns the runtime lifetime.
func (*Bridge) Assignments ¶
func (bridge *Bridge) Assignments() <-chan llm.WorkerAssignmentDelivery
func (*Bridge) Close ¶
Close shuts the underlying legacy client down and ends the pump. Signaling closing first unblocks a pump parked on a full assignments/rejections channel (its consumer may already be gone), so Close cannot deadlock waiting on done.
func (*Bridge) ConfirmAssignment ¶
ConfirmAssignment maps workerkit's accept to the legacy accepted event: the legacy state machine admits progress/final only after "accepted". The event is sent once per completion; a session that already carried an event (e.g. a rejection sent before confirmation) is left untouched.