lemunozm / message-io

Fast and easy-to-use event-driven network library.
Apache License 2.0
1.11k stars 74 forks source link

Modify thread name #112

Open jbabyhacker opened 2 years ago

jbabyhacker commented 2 years ago

I would like the ability to provide an alternate thread name for the threads in for_each() and for_each_async(). If this is a change you are open to incorporating, I can make the change and put up a PR. Any interest?

lemunozm commented 2 years ago

Hi!

I'm open to it :)

How will you enable this functionality without touching the API?

I see some approaches to configure the thread names:

jbabyhacker commented 2 years ago

I was wondering how to do it as well. I think the static variable approach you mentioned would be the best approach.

lemunozm commented 2 years ago

As a suggestion, the crate https://github.com/matklad/once_cell could be usefull