neinp/server.go -rw-r--r-- 7.3 KiB
57a398f8 — Sören Tempel 4 months ago master v0.0.5
Allow multiple outstanding responses

Previously, the send() goroutine would block until an executed response
handler wrote a response to the response channel. If a response handler
does not write a response to the channel immediately, e.g. because it
blocks on some sort of event, neinp would not process further messages
until this response handler unblocks. This is due to the fact that the
send goroutine would be blocked on the response channel.

This commit allows for multiple outstanding responses by executing a
separate send goroutine for each response. Additionally a mutex is
utilized to prevent concurrent writes to the socket. Response handler
error handling has also been slightly adjusted accordingly.
use custom go.rbn.im import path
move to sr.ht and go modulize