Skip to content
This repository has been archived by the owner on Jun 8, 2021. It is now read-only.

Implement equivalents to mpsc::channel() and ::sync_channel() for the MainContext #430

Merged
merged 4 commits into from
Jan 25, 2019
Merged

Implement equivalents to mpsc::channel() and ::sync_channel() for the MainContext #430

merged 4 commits into from
Jan 25, 2019

Conversation

sdroege
Copy link
Member

@sdroege sdroege commented Jan 24, 2019

This allows safely sending items from arbitrary threads to the main context and handling them via a callback.


I'll port the cairo threads example to use this tomorrow.

@sdroege
Copy link
Member Author

sdroege commented Jan 24, 2019

I'll probably also change the API a bit while porting the cairo example, it's currently not ideal yet.

src/lib.rs Outdated Show resolved Hide resolved
@EPashkin
Copy link
Member

Current version looks good, thanks

@sdroege
Copy link
Member Author

sdroege commented Jan 25, 2019

Better version now, also closer API-wise to the std API :)

@sdroege
Copy link
Member Author

sdroege commented Jan 25, 2019

Example usage (apart from the unit tests) here: gtk-rs/examples#222

@sdroege
Copy link
Member Author

sdroege commented Jan 25, 2019

@EPashkin what do you think? :)

@sdroege
Copy link
Member Author

sdroege commented Jan 25, 2019

Improved docs a bit

… MainContext

This allows safely sending items from arbitrary threads to the main
context and handling them via a callback.
@EPashkin
Copy link
Member

@sdroege Thanks, now API much better

@EPashkin
Copy link
Member

👍

@sdroege
Copy link
Member Author

sdroege commented Jan 25, 2019

Thanks for the review :)

@sdroege sdroege merged commit f84b84b into gtk-rs:master Jan 25, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants