I'm implementing a protocol which require a handshake exchange (both ways) before sending messages.
The handshake and the message require a completely different pipeline.
I made my handlers statefull with a isHandshaked property that I set when the handshake handler get its handshake. This is quite inconvenient as I need to find the statefull handlers by types which isn't easy when using multiples handlers of the same kind.
Also this means I can't use some premade handlers like ByteToMessagehandlers as there is no way to pass my state to the coder/decoder. (I made some passthrough handlers to solve this but its qui fragile)
What's the preferred way to setup branching ? I found a forum message saying it's quite common with some code extracts but I can't find a way to get it working.