docker / libchan

Like Go channels over the network
Apache License 2.0
2.47k stars 142 forks source link

how to set timeout when send a message? #105

Closed didapinchegit closed 8 years ago

dmcgowan commented 8 years ago

Libchan currently does not ack messages. If you are building an application that needs acknowledgement when messages are received the best way to do that with libchan is to send a Sender along with your messages and have the remote end acknowledge by closing or sending an ack message on that channel. To timeout the caller would be responsible for timing out if no ack is received within a desired timeout window. Let me know if you need help with this pattern, I am glad to help out.

For the future of libchan, I am considering allowing fully synchronized channels which would require acks and potential timeouts. That would take some more thought into the libchan interface though which is designed to be simple message transport more like udp than tcp. A related issue https://github.com/docker/libchan/issues/91

Closing this issue, thanks for your interest in libchan!