The (hopefully) final bug in #5 is the fact that we are not tracking object lifetime correctly. I think the elegant way to solve this is to restructure how we queue the packages for sending/receiving.
Currently, this send/receive queue is just that: a queue of WirePackages and file descriptors that get decoded into WireMessages somewhere along the way (this code is currently in Graphics.Sudbury.CABI.Client, but either this code or the solution I propose next should be available for the Haskell API as well, as a step towards solving #2). Probably the better way to set this up is to write some code that orders all packages coming in and going out, and depending on that, decides if objects should be considered alive or dead for certain operations. I'm imagining a pipeline roughly like this:
where MessageQueueManager sequences the incoming/outgoing packages, and makes object lifetime decisions atomically.
If users want to send/receive raw WirePackages, then this pattern still allows that: simply don't use the MessageQueueManager, or insert something between that and the PackageQueueManager.
The complicating factor here is that we'd need to teach MessageQueueManager about decoding WirePackages.
The (hopefully) final bug in #5 is the fact that we are not tracking object lifetime correctly. I think the elegant way to solve this is to restructure how we queue the packages for sending/receiving.
Currently, this send/receive queue is just that: a queue of
WirePackage
s and file descriptors that get decoded intoWireMessage
s somewhere along the way (this code is currently inGraphics.Sudbury.CABI.Client
, but either this code or the solution I propose next should be available for the Haskell API as well, as a step towards solving #2). Probably the better way to set this up is to write some code that orders all packages coming in and going out, and depending on that, decides if objects should be considered alive or dead for certain operations. I'm imagining a pipeline roughly like this:where
MessageQueueManager
sequences the incoming/outgoing packages, and makes object lifetime decisions atomically.If users want to send/receive raw
WirePackage
s, then this pattern still allows that: simply don't use theMessageQueueManager
, or insert something between that and thePackageQueueManager
.The complicating factor here is that we'd need to teach
MessageQueueManager
about decodingWirePackage
s.(names may change)