Skip to content

Is it possible to allow SSE::Client to control the underlying thread? #72

@pekopekopekopayo

Description

@pekopekopekopayo

Hello, sorry for creating issues repeatedly.

Would it be possible to expose control of the underlying thread from SSE::Client?

Here is the relevant code:

module SSE
  class Client
    def initialize(...)
      ....
      @thread = Thread.new { run_stream }
      @thread.name = THREAD_NAME
    end

    def thread
      @thread
    end
  end
end

sse_client = SSE::Client(...)
sse_client.thread.public_send(:kill..join...etc)
...

Adding a method like this would be useful for other users as well, and it could make the client more broadly applicable.

Sorry for the inconvenience, and thank you for your help.

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