// Package io contains the transport domains: an acceptor that owns the // listening socket, reader workers that own the read side and protocol // parsing of one connection at a time, and writer workers that own the write // side. Readers and writers communicate only with fixed channels. package io import ( "git.smesh.lol/torly/pkg/config" tinyspawn "git.smesh.lol/torly/pkg/tinyspawn" "git.smesh.lol/torly/pkg/wire" ) // ReaderData is the per-worker startup configuration. type ReaderData struct { Index int Cfg config.Config } // ReaderChans are the channels bound to a reader worker. type ReaderChans struct { Assign tinyspawn.Duplex[wire.Assign] In tinyspawn.Duplex[wire.Inbound] Ctl tinyspawn.Duplex[wire.WriterCtl] Ack tinyspawn.Duplex[uint8] Stop tinyspawn.Breaker } // WriterData is the per-writer startup configuration. type WriterData struct { Index int } // WriterChans are the channels bound to a writer worker. type WriterChans struct { Ctl tinyspawn.Duplex[wire.WriterCtl] Out tinyspawn.Duplex[wire.Outbound] Ack tinyspawn.Duplex[uint8] Stop tinyspawn.Breaker } // AcceptorData is the accept domain's startup configuration. type AcceptorData struct { Addr string Cfg config.Config } // AcceptorChans are the channels bound to the accept domain. Workers has one // assign duplex per reader worker; the acceptor is the only writer to them. type AcceptorChans struct { Workers []tinyspawn.Duplex[wire.Assign] Ready chan<- wire.Ready Stop tinyspawn.Breaker }