Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

give threads a name prefix #1332

Closed
bmxp opened this issue Jan 27, 2019 · 4 comments
Closed

give threads a name prefix #1332

bmxp opened this issue Jan 27, 2019 · 4 comments

Comments

@bmxp
Copy link

bmxp commented Jan 27, 2019

Just an idea if python-telegram-bot is part of a bigger program:

It would be a nice thing to improve bug finding in bigger programms of which python-telegram-bot is a part of if one could name the thread. Instead of names like

dispatcher
updater
84a23bc3-ec23-4aeb-be53-f24e7af82544_0
84a23bc3-ec23-4aeb-be53-f24e7af82544_1
84a23bc3-ec23-4aeb-be53-f24e7af82544_2
84a23bc3-ec23-4aeb-be53-f24e7af82544_3

I would rather like to see

telegram_dispatcher
telegram_updater
telegram_worker_0
telegram_worker_1
telegram_worker_2
telegram_worker_3

Since any thread has an id anyway, this should not be too difficult.
So instead using uuid4 to name a worker, just give a custom param of name_prefix='telegram' and worker_name='worker'

Thanks in advance!

@jsmnbom
Copy link
Member

jsmnbom commented Jan 30, 2019

This looks like it should be doable, we'll look into it and get back to you.
(note that it might be a while as we're right now pretty focused on getting V12 out asap)

@bmxp
Copy link
Author

bmxp commented Feb 3, 2019

Ok, thanks for letting me know, I am looking forward to this improvement.

@Eldinnie
Copy link
Member

@bmxp good find. Would you be comfortable to PR this yourself?

@bmxp
Copy link
Author

bmxp commented Feb 15, 2019

I would love to but my expertise is not good enough to provide a PR and I am not very good with API creating thus I'd rather step aside and let someone else make a superior solution.
To give some more background: We have an Open Source Project SmartHomeNG and have a plugin which uses the library. To distinguish the threads it will help to have them named.
image

Eldinnie added a commit that referenced this issue Feb 28, 2019
This adds a prefix of `Bot:<id>:worker:` to the name of the worker threads.
Fixes #1332
Eldinnie added a commit that referenced this issue Jun 6, 2019
This adds a prefix of `Bot:<id>:worker:` to the name of the worker threads.
Fixes #1332
@tsnoam tsnoam closed this as completed in edad6e8 Aug 23, 2019
@github-actions github-actions bot locked and limited conversation to collaborators Aug 21, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants