haskell-distributed / network-transport-tcp

TCP Realisation of Network.Transport
http://haskell-distributed.github.com
BSD 3-Clause "New" or "Revised" License
30 stars 27 forks source link

Example of input blocking #45

Closed avieth closed 7 years ago

avieth commented 7 years ago

This is just one idea for how network-transport ticket 32 could be realized in network-transport-tcp. This changeset doesn't assume any changes to network-transport, but shows how we might create EndPoints by giving a Policy for accepting input. So the abstract API would change to include something like

newEndPoint :: Transport -> Policy -> IO (Either Error EndPoint)

See the example included examples/Block.hs.

Please share your thoughts! What do you like? What don't you like? Is this a horrible idea?

qnikst commented 7 years ago

In general it looks good, though what I'm concerned about are:

  1. we need some tests that will make semantics explicit and make corner cases at explicit.

  2. Test fails. Either some problem in test was uncovered (this happened before) or there is some problem with code.

  3. (possibly not a problem) we have some sort of a handshake during channels close and creation. When we block local socket will remote side also happy about what had happens.

avieth commented 7 years ago

I gave this a bit more thought and I think #46 is a better approach. It doesn't implement blocking of input as this one does, but rather queueing and buffering controls.

avieth commented 7 years ago

Closing in favour of #46