Thread-safe connections

Issue #37 invalid
Flozza created an issue

Long term goal would be to have thread-safe connections. This would allow for connections to be used anywhere. The sending part is easy, but we want to also read responses so we might have to figure out a good way here.

Idea so far: Each connection has a lock that is acquired before sending (in the talk function) and released once the response is ready. One caveat to consider would be what happens if the connection closes: The first one would act like now, raising ConnectionClosedError while the other one currently would have undefined behaviour (probably an IOError?).

Comments (1)

  1. Log in to comment