Raised by @juan-malbeclabs in review of #29 (thread), and noted in that PR body as a known tradeoff.
Problem
As of #29 these four files are byte-identical across three modules — topofbook-parser, marketbyorder-parser, marketbyprice-parser:
sink_json.go
sink_socket.go
timestamp_linux.go
timestamp_other.go
A bug in the socket sink now needs three separate fixes. sink_socket.go is the concerning one: it carries the non-trivial slow-client drop logic and the mutex-held-across-sends reasoning that keeps Close from racing a send.
Fix
Lift them into go/internal, which is already a workspace member consumed by kernel-receiver and xdp-receiver, so there is precedent and no new dependency shape.
Note the OutputSink interface is currently defined per module over each module's own Record type, so the extraction needs a decision on that boundary first — either a shared Record, or the sink taking an interface / pre-serialized lines. Worth settling before the fourth feed lands.
Standalone-per-feed is the established convention and the reason the duplication exists; this is not a call to abandon it wholesale, just to share the transport layer that has no feed-specific content.
Raised by @juan-malbeclabs in review of #29 (thread), and noted in that PR body as a known tradeoff.
Problem
As of #29 these four files are byte-identical across three modules —
topofbook-parser,marketbyorder-parser,marketbyprice-parser:sink_json.gosink_socket.gotimestamp_linux.gotimestamp_other.goA bug in the socket sink now needs three separate fixes.
sink_socket.gois the concerning one: it carries the non-trivial slow-client drop logic and the mutex-held-across-sends reasoning that keepsClosefrom racing a send.Fix
Lift them into
go/internal, which is already a workspace member consumed bykernel-receiverandxdp-receiver, so there is precedent and no new dependency shape.Note the
OutputSinkinterface is currently defined per module over each module's ownRecordtype, so the extraction needs a decision on that boundary first — either a sharedRecord, or the sink taking an interface / pre-serialized lines. Worth settling before the fourth feed lands.Standalone-per-feed is the established convention and the reason the duplication exists; this is not a call to abandon it wholesale, just to share the transport layer that has no feed-specific content.