~/bend-docscommunity

src/lsp/transport/service.bend checks

raw source on the hub · import 0x582b4b0fdf3dafdeecc8c3bfddc5e4db/src/lsp/transport/service.bend as Service

transport: an effect service: one message body in, one out. H is the implementation's handle state; it is affine, so every call hands it back.

1 import
import Base

Types

type Transport source · line 7 · raw

@-H:Type -> Type

effect service over a handle H: receive a body, send a body, each handing the handle back

Definitions

def recv source · line 11 · raw

@-H:Type -> @tt:Transport<H> -> @hh:H -> IO(Pair(H, Maybe<&2, String>))

the next message's body; None when the peer is gone

def send source · line 16 · raw

@-H:Type -> @tt:Transport<H> -> @hh:H -> @body:String -> IO(H)

a body, through a transport