~/bend-docscommunity

camber.bend fails

raw source on the hub · import bend-kit-camber@0.1.0.0/camber.bend as Camber

Bounded affine dependency bundles with typed concurrent operations and explicit close.

1 import
import Base

Types

type Counts source · line 4 · raw

Data

type Outcome source · line 7 · raw

@-E:Data -> @-O:Data -> Data

type CloseResult source · line 13 · raw

Data

type Message source · line 17 · raw

@-R:Type -> @-P:Data -> @-I:Data -> @-E:Data -> @-O:Data -> Type

type Context source · line 25 · raw

@-R:Type -> @-P:Data -> @-I:Data -> @-E:Data -> @-O:Data -> Data

Copy only this context, never the resources. The inbox bounds queued commands; callers must count blocked submissions inside their transport admission limit.

type OwnerStep source · line 108 · raw

@-R:Type -> @-P:Data -> @-I:Data -> @-E:Data -> @-O:Data -> Type

Definitions

def outcome.value source · line 28 · raw

@-E:Data -> @-O:Data -> @result:Result<&2, &2, E, O> -> Outcome<E, O>

def work.return source · line 37 · raw

@-R:Type -> @-P:Data -> @-I:Data -> @-E:Data -> @-O:Data -> @messages:Chan(Message<R, P, I, E, O>) -> @reply:Chan(Outcome<E, O>) -> @result:Pair(R, Result<&2, &2, E, O>) -> IO(Unit)

The resources return through the private owner protocol BEFORE a disposable caller reply. A closed caller reply cannot erase a handle or strand capacity.

def receive.value source · line 113 · raw

@-A:Type -> @value:Maybe<&1, A> -> IO(A)

IO.join closes a one-shot channel; the owner inbox must remain reusable.

def receive source · line 120 · raw

@-A:Type -> @channel:Chan(A) -> IO(A)

def submit source · line 219 · raw

@-R:Type -> @-P:Data -> @-I:Data -> @-E:Data -> @-O:Data -> @context:Context<R, P, I, E, O> -> @principal:P -> @input:I -> @reply:Chan(Outcome<E, O>) -> IO(Bool)

def call.accepted source · line 225 · raw

@-E:Data -> @-O:Data -> @accepted:Bool -> @+reply:Chan(Outcome<E, O>) -> IO(Outcome<E, O>)

def call source · line 237 · raw

@-R:Type -> @-P:Data -> @-I:Data -> @-E:Data -> @-O:Data -> @context:Context<R, P, I, E, O> -> @principal:P -> @input:I -> IO(Outcome<E, O>)

def inspect.value source · line 246 · raw

@value:Maybe<&1, Counts> -> Maybe<&2, Counts>

def inspect.sent source · line 253 · raw

@sent:Bool -> @+reply:Chan(Counts) -> IO(Maybe<&2, Counts>)

def inspect source · line 265 · raw

@-R:Type -> @-P:Data -> @-I:Data -> @-E:Data -> @-O:Data -> @context:Context<R, P, I, E, O> -> IO(Maybe<&2, Counts>)

def close.sent source · line 273 · raw

@sent:Bool -> @+reply:Chan(CloseResult) -> IO(CloseResult)

def close source · line 287 · raw

@-R:Type -> @-P:Data -> @-I:Data -> @-E:Data -> @-O:Data -> @context:Context<R, P, I, E, O> -> IO(CloseResult)

Stop external admissions before close. Busy preserves live context/capacity; retry after admitted operations finish. Stalled operations remain observable.

Templates

template work source · line 47 · raw

@-R:Type -> @-P:Data -> @-I:Data -> @-E:Data -> @-O:Data -> @-handler:(@_:R -> @_:P -> @_:I -> IO(Pair(R, Result<&2, &2, E, O>))) -> @resource:R -> @principal:P -> @input:I -> @messages:Chan(Message<R, P, I, E, O>) -> @reply:Chan(Outcome<E, O>) -> IO(Unit)

template dispose source · line 56 · raw

@-R:Type -> @-destroy:(@_:R -> IO(Unit)) -> @resources:List<&1, R> -> IO(Unit)

template drain.message source · line 67 · raw

@-R:Type -> @-P:Data -> @-I:Data -> @-E:Data -> @-O:Data -> @-destroy:(@_:R -> IO(Unit)) -> @message:Message<R, P, I, E, O> -> IO(Unit)

Closing Base channels retains buffered messages. Drain them and answer stopped callers, rather than stranding accepted commands behind the close command.

template drain.step source · line 84 · raw

@-R:Type -> @-P:Data -> @-I:Data -> @-E:Data -> @-O:Data -> @-destroy:(@_:R -> IO(Unit)) -> @pending:Maybe<&1, Message<R, P, I, E, O>> -> @next:(@_:Unit -> IO(Unit)) -> IO(Unit)

template drain source · line 97 · raw

@-R:Type -> @-P:Data -> @-I:Data -> @-E:Data -> @-O:Data -> @-destroy:(@_:R -> IO(Unit)) -> @fuel:Nat -> @+messages:Chan(Message<R, P, I, E, O>) -> IO(Unit)

The closed inbox contains at most room buffered messages.

template build.step source · line 171 · raw

@-R:Type -> @-E:Data -> @-destroy:(@_:R -> IO(Unit)) -> @result:Result<&2, &1, E, R> -> @resources:List<&1, R> -> @next:(@_:List<&1, R> -> IO(Result<&2, &1, E, List<&1, R>>)) -> IO(Result<&2, &1, E, List<&1, R>>)

template build source · line 183 · raw

@-K:Data -> @-R:Type -> @-E:Data -> @-create:(@_:K -> @_:Nat -> IO(Result<&2, &1, E, R>)) -> @-destroy:(@_:R -> IO(Unit)) -> @remaining:Nat -> @+config:K -> @resources:List<&1, R> -> IO(Result<&2, &1, E, List<&1, R>>)

template start.ready source · line 194 · raw

@-R:Type -> @-P:Data -> @-I:Data -> @-E:Data -> @-O:Data -> @-handler:(@_:R -> @_:P -> @_:I -> IO(Pair(R, Result<&2, &2, E, O>))) -> @-destroy:(@_:R -> IO(Unit)) -> @capacity:Nat -> @+room:U32 -> @result:Result<&2, &1, E, List<&1, R>> -> IO(Result<&2, &2, E, Context<R, P, I, E, O>>)

template start source · line 210 · raw

@-K:Data -> @-R:Type -> @-P:Data -> @-I:Data -> @-E:Data -> @-O:Data -> @-create:(@_:K -> @_:Nat -> IO(Result<&2, &1, E, R>)) -> @-handler:(@_:R -> @_:P -> @_:I -> IO(Pair(R, Result<&2, &2, E, O>))) -> @-destroy:(@_:R -> IO(Unit)) -> @config:K -> @+capacity:Nat -> @room:U32 -> IO(Result<&2, &2, E, Context<R, P, I, E, O>>)

The initializer closes partial handles within a failed bundle; start closes all prior whole bundles. No workers exist until the complete set opens.

Unsafe

unsafe owner source · line 127 · raw

@-R:Type -> @-P:Data -> @-I:Data -> @-E:Data -> @-O:Data -> @-handler:(@_:R -> @_:P -> @_:I -> IO(Pair(R, Result<&2, &2, E, O>))) -> @-destroy:(@_:R -> IO(Unit)) -> @+messages:Chan(Message<R, P, I, E, O>) -> @+room:U32 -> @step:OwnerStep<R, P, I, E, O> -> IO(Unit)

Only idle close ends this loop. Busy close never waits on a stalled handler. @unsafe is solely the lifecycle receive loop, not a termination/proof claim.