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

Threading support, queued Signal connections #3

Open
melevine opened this issue Jan 12, 2017 · 3 comments
Open

Threading support, queued Signal connections #3

melevine opened this issue Jan 12, 2017 · 3 comments

Comments

@melevine
Copy link

Firstly, this project is super cool, thanks for tackling this!

Looking through your tests and code, I don't see much in regards to threading support, or implications of using signals for thread communication. At least in Qt, I see that as a major feature of Signals and Slots. The ability to send a signal/message to a thread and have that message queue is a pretty awesome feature. While I don't see explicit support for this, it's possible that "it just works." If that's the case, it would be great to see some examples of it's usage in a threading context.

@dgovil
Copy link
Owner

dgovil commented Jan 12, 2017

Hi!
Currently there isn't any threading support. Everything is called in the same thread as the signal is emitted from. I'll add that caveat to the ReadMe for now

I think threading support like Qt has would be great, it just seems like it would be complex to support in just Python without needing a base object like a QObject like Qt uses.

I'll need to do some research when I get some free time into how to mimic the behavior for threading.
If you have any ideas or anyone does really, I'm all ears though!

For reference sake here for me (or someone else) in the future is a description of Qt's threading support regarding signals
http://doc.qt.io/qt-4.8/threads-qobject.html

@Ahuge
Copy link

Ahuge commented Feb 11, 2017

I have an implementation of Signals that may, or may not, be interesting to you. I made a basic example doing some async web requests with it here. I want to look into adding event loops to be able to facilitate the queued system at some point, but I've been busy recently :(

@dgovil
Copy link
Owner

dgovil commented Feb 11, 2017

@Ahuge Interesting! Thanks for sharing that.

Maybe I'm misunderstanding your code though, but it still functions within a single thread right? Async ops run in the same thread as the thread they were launched from so it should function fine there, but the signals might fail if doing cross thread calling?

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

No branches or pull requests

3 participants