rsms / peertalk

iOS and Mac Cocoa library for communicating over USB
https://rsms.me/peertalk/
MIT License
3.43k stars 502 forks source link

PTUSBHub connectToDevice in main queue #37

Open jasenhuang opened 7 years ago

jasenhuang commented 7 years ago

why PTUSBHub hard code api that connectToDevice in main queue?

- (void)connectToDevice:(NSNumber*)deviceID port:(int)port onStart:(void(^)(NSError*, dispatch_io_t))onStart onEnd:(void(^)(NSError*))onEnd {
      PTUSBChannel *channel = [PTUSBChannel new];
      NSError *error = nil;
      //open main queue ?
     if (![channel openOnQueue:dispatch_get_main_queue() error:&error onEnd:onEnd]) {
           onStart(error, nil);
           return;
       }
     // ....
}