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

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

Merged
merged 4 commits into from Jan 25, 2019

Conversation

Projects
None yet
3 participants
@sdroege
Copy link
Member

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

This comment has been minimized.

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.

Show resolved Hide resolved src/lib.rs Outdated
@EPashkin

This comment has been minimized.

Copy link
Member

EPashkin commented Jan 25, 2019

Current version looks good, thanks

@sdroege sdroege force-pushed the sdroege:main-context-channel branch from 93aa9ce to 94f0737 Jan 25, 2019

@sdroege

This comment has been minimized.

Copy link
Member Author

sdroege commented Jan 25, 2019

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

@sdroege

This comment has been minimized.

Copy link
Member Author

sdroege commented Jan 25, 2019

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

@sdroege sdroege force-pushed the sdroege:main-context-channel branch 2 times, most recently from 41a1d06 to f304283 Jan 25, 2019

@sdroege sdroege force-pushed the sdroege:main-context-channel branch from f304283 to 9365dc1 Jan 25, 2019

@sdroege

This comment has been minimized.

Copy link
Member Author

sdroege commented Jan 25, 2019

@EPashkin what do you think? :)

@sdroege sdroege force-pushed the sdroege:main-context-channel branch from 9365dc1 to 69894d9 Jan 25, 2019

@sdroege

This comment has been minimized.

Copy link
Member Author

sdroege commented Jan 25, 2019

Improved docs a bit

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

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

@sdroege sdroege force-pushed the sdroege:main-context-channel branch from 69894d9 to 400f983 Jan 25, 2019

@EPashkin

This comment has been minimized.

Copy link
Member

EPashkin commented Jan 25, 2019

@sdroege Thanks, now API much better

@EPashkin

This comment has been minimized.

Copy link
Member

EPashkin commented Jan 25, 2019

👍

@sdroege

This comment has been minimized.

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

2 checks passed

continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.