~/bend-docscommunity

src/coordinator/Client.bend relies on unsafe/foreign

raw source on the hub · import mylsm-lsm-store@0.6.0.2/src/coordinator/Client.bend as Client

9 imports
import Base
import ../ByteMemTable.bend as ByteMemTable
import ./ClientPolicy.bend as Policy
import ./SessionPolicy.bend as SessionPolicy
import ./Io.bend as Io
import ./Operation.bend as Operation
import ./Protocol.bend as Protocol
import ./UnixSocketIo.bend as UnixSocket
import bend-kit-bytes@0.3.2.0/bytes.bend as Bytes

Types

type Error source · line 12 · raw

Type

Returns connection, transport, correlation, and retry-boundary outcomes.

type Session source · line 24 · raw

Type

Keeps one canonical endpoint, owner generation, and request sequence.

Definitions

def u32.clone.pair.from source · line 28 · raw

@triple:Pair(U32, Pair(U32, U32)) -> Pair(U32, U32)

def u32.clone.pair source · line 32 · raw

@value:U32 -> Pair(U32, U32)

def request.clone.payload source · line 35 · raw

@versions:Pair(U32, U32) -> @generations:Pair(U32, U32) -> @request_ids:Pair(U32, U32) -> @operations:Pair(U32, U32) -> @payloads:Pair(0x185ae03c75e3e75be1171471f68b43cb/bytes.Bytes, 0x185ae03c75e3e75be1171471f68b43cb/bytes.Bytes) -> Pair(0x7586b743ff7fd05e412d5115859629b6/src/coordinator/Protocol.Request, 0x7586b743ff7fd05e412d5115859629b6/src/coordinator/Protocol.Request)

def request.clone.pair source · line 57 · raw

@request:0x7586b743ff7fd05e412d5115859629b6/src/coordinator/Protocol.Request -> Pair(0x7586b743ff7fd05e412d5115859629b6/src/coordinator/Protocol.Request, 0x7586b743ff7fd05e412d5115859629b6/src/coordinator/Protocol.Request)

def status.clone.pair source · line 66 · raw

@status:0x7586b743ff7fd05e412d5115859629b6/src/coordinator/Protocol.ResponseStatus -> Pair(0x7586b743ff7fd05e412d5115859629b6/src/coordinator/Protocol.ResponseStatus, 0x7586b743ff7fd05e412d5115859629b6/src/coordinator/Protocol.ResponseStatus)

def response.clone.payload source · line 90 · raw

@versions:Pair(U32, U32) -> @generations:Pair(U32, U32) -> @request_ids:Pair(U32, U32) -> @statuses:Pair(0x7586b743ff7fd05e412d5115859629b6/src/coordinator/Protocol.ResponseStatus, 0x7586b743ff7fd05e412d5115859629b6/src/coordinator/Protocol.ResponseStatus) -> @payloads:Pair(0x185ae03c75e3e75be1171471f68b43cb/bytes.Bytes, 0x185ae03c75e3e75be1171471f68b43cb/bytes.Bytes) -> Pair(0x7586b743ff7fd05e412d5115859629b6/src/coordinator/Protocol.Response, 0x7586b743ff7fd05e412d5115859629b6/src/coordinator/Protocol.Response)

def response.clone.pair source · line 112 · raw

@response:0x7586b743ff7fd05e412d5115859629b6/src/coordinator/Protocol.Response -> Pair(0x7586b743ff7fd05e412d5115859629b6/src/coordinator/Protocol.Response, 0x7586b743ff7fd05e412d5115859629b6/src/coordinator/Protocol.Response)

def result.failure source · line 122 · raw

@error:Error -> Result<&1, &1, Error, 0x7586b743ff7fd05e412d5115859629b6/src/coordinator/Protocol.Response>

def result.response source · line 125 · raw

@response:0x7586b743ff7fd05e412d5115859629b6/src/coordinator/Protocol.Response -> Result<&1, &1, Error, 0x7586b743ff7fd05e412d5115859629b6/src/coordinator/Protocol.Response>

def disconnect.error source · line 130 · raw

@mutation:Bool -> @error:0x7586b743ff7fd05e412d5115859629b6/src/coordinator/Io.Error -> Error

def response.validation.fields source · line 135 · raw

@response_fields:Pair(U32, Pair(U32, U32)) -> @request_fields:Pair(U32, Pair(U32, U32)) -> @generations:Pair(U32, Pair(U32, U32)) -> 0x7586b743ff7fd05e412d5115859629b6/src/coordinator/ClientPolicy.Decision

def response.validation.request source · line 154 · raw

@response:0x7586b743ff7fd05e412d5115859629b6/src/coordinator/Protocol.Response -> @request:0x7586b743ff7fd05e412d5115859629b6/src/coordinator/Protocol.Request -> @generations:Pair(U32, Pair(U32, U32)) -> 0x7586b743ff7fd05e412d5115859629b6/src/coordinator/ClientPolicy.Decision

def response.validation source · line 168 · raw

@response:0x7586b743ff7fd05e412d5115859629b6/src/coordinator/Protocol.Response -> @request:0x7586b743ff7fd05e412d5115859629b6/src/coordinator/Protocol.Request -> @generation:U32 -> 0x7586b743ff7fd05e412d5115859629b6/src/coordinator/ClientPolicy.Decision

def response.checked.result source · line 176 · raw

@response:0x7586b743ff7fd05e412d5115859629b6/src/coordinator/Protocol.Response -> @decision:0x7586b743ff7fd05e412d5115859629b6/src/coordinator/ClientPolicy.Decision -> Result<&1, &1, Error, 0x7586b743ff7fd05e412d5115859629b6/src/coordinator/Protocol.Response>

def response.checked.request_copy source · line 186 · raw

@retained:0x7586b743ff7fd05e412d5115859629b6/src/coordinator/Protocol.Response -> @checked:0x7586b743ff7fd05e412d5115859629b6/src/coordinator/Protocol.Response -> @generation:U32 -> @requests:Pair(0x7586b743ff7fd05e412d5115859629b6/src/coordinator/Protocol.Request, 0x7586b743ff7fd05e412d5115859629b6/src/coordinator/Protocol.Request) -> Result<&1, &1, Error, 0x7586b743ff7fd05e412d5115859629b6/src/coordinator/Protocol.Response>

def response.checked.copies source · line 197 · raw

@responses:Pair(0x7586b743ff7fd05e412d5115859629b6/src/coordinator/Protocol.Response, 0x7586b743ff7fd05e412d5115859629b6/src/coordinator/Protocol.Response) -> @requests:Pair(0x7586b743ff7fd05e412d5115859629b6/src/coordinator/Protocol.Request, 0x7586b743ff7fd05e412d5115859629b6/src/coordinator/Protocol.Request) -> @generation:U32 -> Result<&1, &1, Error, 0x7586b743ff7fd05e412d5115859629b6/src/coordinator/Protocol.Response>

def response.checked source · line 206 · raw

@response:0x7586b743ff7fd05e412d5115859629b6/src/coordinator/Protocol.Response -> @request:0x7586b743ff7fd05e412d5115859629b6/src/coordinator/Protocol.Request -> @generation:U32 -> Result<&1, &1, Error, 0x7586b743ff7fd05e412d5115859629b6/src/coordinator/Protocol.Response>

def response.read source · line 214 · raw

@pair:Pair(File, Result<&1, &1, 0x7586b743ff7fd05e412d5115859629b6/src/coordinator/Io.Error, 0x7586b743ff7fd05e412d5115859629b6/src/coordinator/Protocol.Response>) -> @request:0x7586b743ff7fd05e412d5115859629b6/src/coordinator/Protocol.Request -> @generation:U32 -> @mutation:Bool -> IO(Result<&1, &1, Error, 0x7586b743ff7fd05e412d5115859629b6/src/coordinator/Protocol.Response>)

def response.request source · line 230 · raw

@client:File -> @request:0x7586b743ff7fd05e412d5115859629b6/src/coordinator/Protocol.Request -> @generation:U32 -> @mutation:Bool -> IO(Result<&1, &1, Error, 0x7586b743ff7fd05e412d5115859629b6/src/coordinator/Protocol.Response>)

def written source · line 242 · raw

@pair:Pair(File, Result<&1, &1, Pair(U32, String), Unit>) -> @request:0x7586b743ff7fd05e412d5115859629b6/src/coordinator/Protocol.Request -> @generation:U32 -> @mutation:Bool -> IO(Result<&1, &1, Error, 0x7586b743ff7fd05e412d5115859629b6/src/coordinator/Protocol.Response>)

Sends a frame result into response reading or mutation uncertainty.

def connected.requests source · line 257 · raw

@client:File -> @generation:U32 -> @mutation:Bool -> @requests:Pair(0x7586b743ff7fd05e412d5115859629b6/src/coordinator/Protocol.Request, 0x7586b743ff7fd05e412d5115859629b6/src/coordinator/Protocol.Request) -> IO(Result<&1, &1, Error, 0x7586b743ff7fd05e412d5115859629b6/src/coordinator/Protocol.Response>)

def connected source · line 271 · raw

@pair:Pair(File, Result<&1, &1, 0x7586b743ff7fd05e412d5115859629b6/src/coordinator/UnixSocketIo.Error, Unit>) -> @request:0x7586b743ff7fd05e412d5115859629b6/src/coordinator/Protocol.Request -> @generation:U32 -> @mutation:Bool -> IO(Result<&1, &1, Error, 0x7586b743ff7fd05e412d5115859629b6/src/coordinator/Protocol.Response>)

Writes one request after the owner endpoint accepts the connection.

def created source · line 287 · raw

@result:Result<&1, &1, 0x7586b743ff7fd05e412d5115859629b6/src/coordinator/UnixSocketIo.Error, File> -> @endpoint:String -> @request:0x7586b743ff7fd05e412d5115859629b6/src/coordinator/Protocol.Request -> @generation:U32 -> @mutation:Bool -> IO(Result<&1, &1, Error, 0x7586b743ff7fd05e412d5115859629b6/src/coordinator/Protocol.Response>)

Connects a new socket and classifies failures before dispatch.

def call.admitted source · line 304 · raw

@endpoint:String -> @request:0x7586b743ff7fd05e412d5115859629b6/src/coordinator/Protocol.Request -> @generation:U32 -> @mutation:Bool -> @admitted:Bool -> IO(Result<&1, &1, Error, 0x7586b743ff7fd05e412d5115859629b6/src/coordinator/Protocol.Response>)

def call.request.size source · line 321 · raw

@endpoint:String -> @fields:Pair(U32, Pair(U32, Pair(U32, Pair(U32, U32)))) -> @generation:U32 -> @measured_payload:Pair(0x185ae03c75e3e75be1171471f68b43cb/bytes.Bytes, U32) -> IO(Result<&1, &1, Error, 0x7586b743ff7fd05e412d5115859629b6/src/coordinator/Protocol.Response>)

def call source · line 339 · raw

@endpoint:String -> @request:0x7586b743ff7fd05e412d5115859629b6/src/coordinator/Protocol.Request -> @generation:U32 -> IO(Result<&1, &1, Error, 0x7586b743ff7fd05e412d5115859629b6/src/coordinator/Protocol.Response>)

Sends one bounded owner request and never retries it implicitly.

def string.clone.pair.go source · line 351 · raw

@value:String -> @left:String -> @right:String -> Pair(String, String)

def string.clone.pair source · line 361 · raw

@value:String -> Pair(String, String)

def session.open source · line 365 · raw

@endpoint:String -> @generation:U32 -> Session

Starts one client session with its first request identifier.

def session.clone.ready source · line 368 · raw

@endpoints:Pair(String, String) -> @generations:Pair(U32, U32) -> @requests:Pair(0x7586b743ff7fd05e412d5115859629b6/src/coordinator/ClientPolicy.RequestSequence, 0x7586b743ff7fd05e412d5115859629b6/src/coordinator/ClientPolicy.RequestSequence) -> Pair(Session, Session)

def session.clone source · line 382 · raw

@session:Session -> Pair(Session, Session)

def session.call.ready source · line 388 · raw

@endpoints:Pair(String, String) -> @generations:Pair(U32, Pair(U32, U32)) -> @request_id:U32 -> @operation:U32 -> @next:0x7586b743ff7fd05e412d5115859629b6/src/coordinator/ClientPolicy.RequestSequence -> @payload:0x185ae03c75e3e75be1171471f68b43cb/bytes.Bytes -> IO(Pair(Session, Result<&1, &1, Error, 0x7586b743ff7fd05e412d5115859629b6/src/coordinator/Protocol.Response>))

def session.call.decision source · line 408 · raw

@endpoint:String -> @generation:U32 -> @operation:U32 -> @payload:0x185ae03c75e3e75be1171471f68b43cb/bytes.Bytes -> @decision:0x7586b743ff7fd05e412d5115859629b6/src/coordinator/ClientPolicy.RequestDecision -> IO(Pair(Session, Result<&1, &1, Error, 0x7586b743ff7fd05e412d5115859629b6/src/coordinator/Protocol.Response>))

def session.call source · line 425 · raw

@session:Session -> @operation:U32 -> @payload:0x185ae03c75e3e75be1171471f68b43cb/bytes.Bytes -> IO(Pair(Session, Result<&1, &1, Error, 0x7586b743ff7fd05e412d5115859629b6/src/coordinator/Protocol.Response>))

Sends one operation with the next unique ID and retains the updated session.

def session.get source · line 436 · raw

@session:Session -> @key:0x185ae03c75e3e75be1171471f68b43cb/bytes.Bytes -> IO(Pair(Session, Result<&1, &1, Error, 0x7586b743ff7fd05e412d5115859629b6/src/coordinator/Protocol.Response>))

Sends a byte get and retains the next request sequence.

def session.put source · line 443 · raw

@session:Session -> @key:0x185ae03c75e3e75be1171471f68b43cb/bytes.Bytes -> @value:0x185ae03c75e3e75be1171471f68b43cb/bytes.Bytes -> IO(Pair(Session, Result<&1, &1, Error, 0x7586b743ff7fd05e412d5115859629b6/src/coordinator/Protocol.Response>))

Sends a byte put and retains the next request sequence.

def session.delete source · line 451 · raw

@session:Session -> @key:0x185ae03c75e3e75be1171471f68b43cb/bytes.Bytes -> IO(Pair(Session, Result<&1, &1, Error, 0x7586b743ff7fd05e412d5115859629b6/src/coordinator/Protocol.Response>))

Sends a byte delete and retains the next request sequence.

def session.flush source · line 458 · raw

@session:Session -> IO(Pair(Session, Result<&1, &1, Error, 0x7586b743ff7fd05e412d5115859629b6/src/coordinator/Protocol.Response>))

Sends a flush operation and retains the next request sequence.

def session.compact source · line 464 · raw

@session:Session -> IO(Pair(Session, Result<&1, &1, Error, 0x7586b743ff7fd05e412d5115859629b6/src/coordinator/Protocol.Response>))

Sends a compaction operation and retains the next request sequence.

def session.stats source · line 470 · raw

@session:Session -> IO(Pair(Session, Result<&1, &1, Error, 0x7586b743ff7fd05e412d5115859629b6/src/coordinator/Protocol.Response>))

Sends a stats operation and retains the next request sequence.

def session.describe_owner source · line 475 · raw

@session:Session -> IO(Pair(Session, Result<&1, &1, Error, 0x7586b743ff7fd05e412d5115859629b6/src/coordinator/Protocol.Response>))