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

Make the default and error handlers Send + Sync #517

Merged
merged 3 commits into from Feb 7, 2022
Merged

Conversation

Hirrolot
Copy link
Collaborator

@Hirrolot Hirrolot commented Feb 7, 2022

Reduces the pain in the ass when trying to use the dispatcher in tokio::spawn or similar.
Discussion: https://t.me/teloxide/6529.

@WaffleLapkin
Copy link
Member

That's technically a breaking change, but it's an overlook and a painful one, so maybe we want to release 0.6.2 with this fix and then yank the 0.6.1?

@Hirrolot
Copy link
Collaborator Author

Hirrolot commented Feb 7, 2022

But v0.6.2 would not indicate a breaking change IIRC. v0.7.0 would, wouldn't it?

@WaffleLapkin
Copy link
Member

Yes, you are right. Well that's the trick, if we pretend that 0.6.{0,1} never happened then 0.5->0.6 can break :D

I'm not sure that's a good approach, but at the same time not being able to spawn dispatcher is a noticeable problem which we better fix asap.

@Hirrolot
Copy link
Collaborator Author

Hirrolot commented Feb 7, 2022

Technically speaking, if we release v0.6.2 with this fix, someone's working code might accidentally break (some bots have been already rewritten using dispatching2). Even if we yank v0.6.1.

Maybe it's better to release v0.7.0 with this fix?

@WaffleLapkin
Copy link
Member

Sure, let's release it as 0.7

Copy link
Member

@WaffleLapkin WaffleLapkin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me. Can you add a test that would show that new Dispatcher is Send+Sync/can be spawned?

@Hirrolot Hirrolot merged commit 0cda7aa into dev Feb 7, 2022
@Hirrolot Hirrolot deleted the handlers-send-sync branch February 7, 2022 22:04
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.

None yet

2 participants