-
Notifications
You must be signed in to change notification settings - Fork 33
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 MainLoopSynchronizationContext.Send
#915
base: main
Are you sure you want to change the base?
Conversation
Thanks for your PR. We explicitly did not implement the Do you have any insight on how to trigger the method or for which use cases it is used (perhaps even some examples / documentation)? If this is clarified we can go ahead and add some tests to your PR and then merge it. The tests should probably be part of: https://github.com/gircore/gir.core/blob/main/src/Tests/Libs/GLib-2.0.Tests/SynchronizationContextTest.cs |
Thanks for the swift response. Our use case involved creating our own We acquired a reference to the GLib I'm not exactly sure how to integrate this into the GLib tests either. |
After reading several implementations I think the correct thing to do would be to call MainLoop.Invoke as it does the right thing as far as I understand. Your implementation is basically the last resort execution mentioned in the linked documentation which is fine but misses some optimizations mentioned there. To test this I think it would be okay to manually invoke the @cameronwhite: any thoughts? |
My understanding is that |
@ShortDevelopment I saw in your project that you implemented the Send-Method on a synchronization context. Do you have some more insight why this method is important except calling it manually? I wonder if this should be implemented in the way I mentioned in #915 (comment). Any feedback is appreciated. |
@badcel I honestly did not expect someone to find this new repo that quickly 😅. I'm using the "lowlevel" Tmds.DBus.Protocol library to interop with BLueZ DBus and there's a single "manual" call to This was just a quick hack to get it to work. Also I just noticed I'm calling the delegate twice... |
Thanks for the quick reply. It helps a lot to know that not some application developer but library developer would do the call manually like in the scenario you mentioned. In this case I think there should be something done in regard to this PR. P.S. I'm always looking for GirCore code from real world applications which could be a good starting template for newcomers to GTK. Especially your builder pattern is pretty clever and creates a nice and clean api to use. You can find other projects using your own library pretty easy via GitHub insights. |
Tests still need to be written, if they are necessary.