Skip to content

Thread-safe client implementation #187

@tobiasmcnulty

Description

@tobiasmcnulty

Hello, I noticed that the README suggests starting a separate thread to call listen(), but I don't believe the underlying socket is thread-safe (unless I'm missing something of course).

I believe I've worked out an implementation that at least allows send_message() to avoid clobbering any enquire_link or other PDUs the socket might be exchanging at the time send_message() is called.

Would it be worth cleaning this up and submitting a PR? If so, how would you like me to approach it? A few options I can think of:

  1. Include the minimal hooks necessary (if any) for someone to implement their own client outside of smpplib proper
  2. Update the existing client to use the thread-safe socket implementation
  3. Include an alternate ThreadSafeClient implementation, as in the linked gist

Thanks for this library and in advance for any input you may have!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions