src/coordinator/UnixSocketIo.bend relies on unsafe/foreign
raw source on the hub · import mylsm-lsm-store@0.6.0.0/src/coordinator/UnixSocketIo.bend as UnixSocketIo
3 imports
import Base import ./UnixSocketPolicy.bend as Policy import ./UnixSocketTypes.bend as SocketTypes
Types
type Error source · line 6 · raw
Data
Represents an unavailable socket primitive or another raw host failure.
UnsupportedPlatformError
Transient@code:U32 -> Error
Host@code:U32 -> @message:String -> Error
type PollStatus source · line 12 · raw
Data
Carries the state for PollStatus.
ReadablePollStatus
ReadableFailedPollStatus
IdlePollStatus
FailedPollStatus
Definitions
def unsupported_code source · line 19 · raw
@+code:U32 -> Bool
Classifies the platform-specific unsupported syscall codes.
def classify.mapping source · line 24 · raw
@classification:0x8f9a5c58059f5db5361cb2eddb73ec7f/src/coordinator/UnixSocketPolicy.Classification -> @message:String -> Error
Converts one host code and message to the socket error domain.
def classify source · line 34 · raw
@pair:Pair(U32, String) -> Error
Converts a pure platform classification into the socket error surface.
def classify_result source · line 40 · raw
@result:Result<&1, &1, Pair(U32, String), Unit> -> Result<&1, &1, Error, Unit>
Preserves ordinary host errors and types unsupported platforms.
def classify_file_unit source · line 48 · raw
@pair:Pair(File, Result<&1, &1, Pair(U32, String), Unit>) -> Pair(File, Result<&1, &1, Error, Unit>)
Rewrites the error domain without consuming the socket descriptor.
def classify_file_result source · line 55 · raw
@pair:Pair(File, Result<&1, &1, Pair(U32, String), File>) -> Pair(File, Result<&1, &1, Error, File>)
Rewrites an accepted descriptor's error domain.
def classify_poll_result source · line 63 · raw
@result:Result<&1, &1, Pair(U32, String), U32> -> Result<&1, &1, Error, U32>
Handles classify poll result.
def poll.status.classified source · line 70 · raw
@status:0x8f9a5c58059f5db5361cb2eddb73ec7f/src/coordinator/UnixSocketPolicy.PollStatus -> PollStatus
def poll.status source · line 77 · raw
@flags:U32 -> PollStatus
def poll.failure.retryable source · line 80 · raw
@action:0x8f9a5c58059f5db5361cb2eddb73ec7f/src/coordinator/UnixSocketPolicy.PollFailureAction -> Bool
def poll.error.retryable source · line 85 · raw
@error:Error -> Bool
def classify_created source · line 91 · raw
@result:Result<&1, &1, Pair(U32, String), File> -> Result<&1, &1, Error, File>
Rewrites a socket-creation error into the typed platform domain.
def create source · line 104 · raw
IO(Result<&1, &1, Error, File>)
Creates one stream socket and types unsupported-platform failures.
def bind source · line 118 · raw
@server:File -> @path:String -> IO(Pair(File, Result<&1, &1, Error, Unit>))
Binds one socket descriptor to an already validated local endpoint path.
def listen source · line 136 · raw
@server:File -> @backlog:U32 -> IO(Pair(File, Result<&1, &1, Error, Unit>))
Starts listening on one bound socket descriptor.
def accept source · line 153 · raw
@server:File -> IO(Pair(File, Result<&1, &1, Error, File>))
Accepts one queued connection and preserves the listening descriptor.
def nonblocking source · line 169 · raw
@socket:File -> IO(Pair(File, Result<&1, &1, Error, Unit>))
Handles nonblocking.
def classify_poll_pair source · line 187 · raw
@pair:Pair(File, Result<&1, &1, Pair(U32, String), U32>) -> Pair(File, Result<&1, &1, Error, U32>)
Handles classify poll pair.
def poll source · line 194 · raw
@socket:File -> @events:U32 -> @timeout_ms:U32 -> IO(Pair(File, Result<&1, &1, Error, U32>))
Handles poll.
def poll_many.result source · line 213 · raw
@pair:Pair(List<&1, 0x8f9a5c58059f5db5361cb2eddb73ec7f/src/coordinator/UnixSocketTypes.PollInterest>, Result<&1, &1, Pair(U32, String), List<&2, 0x8f9a5c58059f5db5361cb2eddb73ec7f/src/coordinator/UnixSocketTypes.ReadyEvent>>) -> Pair(List<&1, 0x8f9a5c58059f5db5361cb2eddb73ec7f/src/coordinator/UnixSocketTypes.PollInterest>, Result<&1, &1, Error, List<&2, 0x8f9a5c58059f5db5361cb2eddb73ec7f/src/coordinator/UnixSocketTypes.ReadyEvent>>)
def poll_many source · line 222 · raw
@interests:List<&1, 0x8f9a5c58059f5db5361cb2eddb73ec7f/src/coordinator/UnixSocketTypes.PollInterest> -> @timeout_ms:U32 -> IO(Pair(List<&1, 0x8f9a5c58059f5db5361cb2eddb73ec7f/src/coordinator/UnixSocketTypes.PollInterest>, Result<&1, &1, Error, List<&2, 0x8f9a5c58059f5db5361cb2eddb73ec7f/src/coordinator/UnixSocketTypes.ReadyEvent>>))
Handles poll many.
def connect source · line 243 · raw
@client:File -> @path:String -> IO(Pair(File, Result<&1, &1, Error, Unit>))
Connects one client socket descriptor to a validated local endpoint path.
Effects (foreign code)
effect unix_socket_create source · line 99 · raw
IO(Result<&1, &1, Pair(U32, String), File>)
Creates one stream socket through the paired host effects.
foreign: src/effs/unix_socket_create.c, src/effs/unix_socket_create.js
effect unix_socket_bind source · line 110 · raw
@server:File -> @path:String -> IO(Pair(File, Result<&1, &1, Pair(U32, String), Unit>))
Binds one socket descriptor to an already validated local endpoint path.
foreign: src/effs/unix_socket_bind.c, src/effs/unix_socket_bind.js
effect unix_socket_listen source · line 128 · raw
@server:File -> @backlog:U32 -> IO(Pair(File, Result<&1, &1, Pair(U32, String), Unit>))
Starts listening on one bound socket descriptor.
foreign: src/effs/unix_socket_listen.c, src/effs/unix_socket_listen.js
effect unix_socket_accept source · line 146 · raw
@server:File -> IO(Pair(File, Result<&1, &1, Pair(U32, String), File>))
Accepts one queued connection and preserves the listening descriptor.
foreign: src/effs/unix_socket_accept.c, src/effs/unix_socket_accept.js
effect unix_socket_nonblocking source · line 162 · raw
@socket:File -> IO(Pair(File, Result<&1, &1, Pair(U32, String), Unit>))
Handles unix socket nonblocking.
foreign: src/effs/unix_socket_nonblocking.c, src/effs/unix_socket_nonblocking.js
effect unix_socket_poll source · line 178 · raw
@socket:File -> @events:U32 -> @timeout_ms:U32 -> IO(Pair(File, Result<&1, &1, Pair(U32, String), U32>))
Handles unix socket poll.
foreign: src/effs/unix_socket_poll.c, src/effs/unix_socket_poll.js
effect unix_socket_poll_many source · line 205 · raw
@interests:List<&1, 0x8f9a5c58059f5db5361cb2eddb73ec7f/src/coordinator/UnixSocketTypes.PollInterest> -> @timeout_ms:U32 -> IO(Pair(List<&1, 0x8f9a5c58059f5db5361cb2eddb73ec7f/src/coordinator/UnixSocketTypes.PollInterest>, Result<&1, &1, Pair(U32, String), List<&2, 0x8f9a5c58059f5db5361cb2eddb73ec7f/src/coordinator/UnixSocketTypes.ReadyEvent>>))
Handles unix socket poll many.
foreign: src/effs/unix_socket_poll_many.c, src/effs/unix_socket_poll_many.js
effect unix_socket_connect source · line 235 · raw
@client:File -> @path:String -> IO(Pair(File, Result<&1, &1, Pair(U32, String), Unit>))
Connects one client socket descriptor to a validated local endpoint path.
foreign: src/effs/unix_socket_connect.c, src/effs/unix_socket_connect.js