Skip to content

Give the main WebSocketClient thread a name#464

Closed
cjgriscom wants to merge 1 commit into
TooTallNate:masterfrom
cjgriscom:cjgriscom-patch-1
Closed

Give the main WebSocketClient thread a name#464
cjgriscom wants to merge 1 commit into
TooTallNate:masterfrom
cjgriscom:cjgriscom-patch-1

Conversation

@cjgriscom
Copy link
Copy Markdown

Only the read thread is assigned a name in a WebSocketClient instance. The main Runnable acquires a default name like "Thread-7". I'm working on an application where I need to identify threads and manage them, and it would be nice to be able to distinguish them purely by name instead of inspecting their stack trace. This modification gives the unnamed thread the identifier "WebsocketMainThread".

@cjgriscom cjgriscom closed this Apr 26, 2017
@cjgriscom cjgriscom deleted the cjgriscom-patch-1 branch April 26, 2017 22:26
@cjgriscom
Copy link
Copy Markdown
Author

I was mistaken; it looks like this is already fixed in the latest version.

@oakkitten
Copy link
Copy Markdown

oakkitten commented Feb 14, 2018

i don't think it was fixed; the connect() method creates a writeThread field which is overwritten with a new WebsocketWriteThread when the thread runs. WebsocketWriteThread sets the name, but the thread started in the connect() method continues to run with the default name. reopen the issue?

also, i would suggest number-naming the threads, as in WebsocketWriteThread-1

edit: also, a new Timer is created in AbstractWebSocket. seems it also lacks a name

@marci4
Copy link
Copy Markdown
Collaborator

marci4 commented Feb 14, 2018

@cjgriscom could you please open a new issue for this? Thank you!

Greetings
marci4

@cjgriscom
Copy link
Copy Markdown
Author

cjgriscom commented Feb 14, 2018

@marci4 Done: #666

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants