def session.call.ready

mylsm-lsm-store@0.6.0.1 · src/coordinator/Client.bend:388

import mylsm-lsm-store@0.6.0.1/src/coordinator/Client.bend as Client
import Base
import mylsm-lsm-store@0.6.0.1/src/coordinator/ClientPolicy.bend as Policy
import mylsm-lsm-store@0.6.0.1/src/coordinator/Protocol.bend as Protocol
import bend-kit-bytes@0.3.2.0/bytes.bend as Bytes

388def session.call.ready(
389  endpoints: String & String,
390  generations: U32 & U32 & U32,
391  request_id: U32,
392  operation: U32,
393  next: Policy.RequestSequence,
394  payload: Bytes.Bytes
395) -> IO(Session & Result<&1, &1, Error, Protocol.Response>):
396  match endpoints:
397    case (call_endpoint, retained_endpoint):
398      match generations:
399        case (request_generation, (active_generation, retained_generation)):
400          do IO<Session & Result<&1, &1, Error, Protocol.Response>>:
401            response : Result<&1, &1, Error, Protocol.Response> <-
402              call(call_endpoint,
403                Protocol.Request{1, request_generation, request_id,
404                  operation, payload}, active_generation)
405            return (Session{retained_endpoint, retained_generation, next},
406              response)

Uses (15)

Used by (1)