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

Specify the thread where callback handler is executed #156

Closed

Conversation

kumabook
Copy link

@kumabook kumabook commented Apr 30, 2016

Hi,

I have used APIKit and I want to say thank you.

I'm trying to use this library for command line application with Commandant and ReactiveCocoa.
I tried to use SignalProducer#single() in order to get result synchronously, but it doesn't get result.
Currently, callback handlers always are executed on main thread.
For command line application, it is good to specify the thread where callback handler are executed.
I tried to modify to specify the thread, it works for me.
Please use it as a reference.

Thank you.

@ishkawa
Copy link
Owner

ishkawa commented May 1, 2016

Looks nice 👍

It would be good to extend this for NSOperationQueue and private queue of Session:

public enum CallbackQueue {
    case Main
    case SessionQueue
    case OperationQueue(NSOperationQueue)
    case DispatchQueue(dispatch_queue_t)
}

@ishkawa
Copy link
Owner

ishkawa commented May 1, 2016

I'll work on another PR soon. Thank you for the nice suggestion ✨

@ishkawa ishkawa mentioned this pull request May 1, 2016
@ishkawa
Copy link
Owner

ishkawa commented May 1, 2016

Closing this in favor of #157.

@kumabook Could you confirm #157 works as expected in your case?

@ishkawa ishkawa closed this May 1, 2016
@kumabook
Copy link
Author

kumabook commented May 1, 2016

@ishkawa Thank a lot! I confirmed. It worked perfectly fine for me! And the implementation looks more swifty!

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.

2 participants