1 Reply
      Latest reply on Jan 12, 2020 12:53 AM by TomerN
      markturnip Level 1 Level 1 (10 points)

        Is there any example of establishing a EASession streams on a queue run loop besides the main loop?

         

        Here's an example of our approach, but would like to know further details.

         

        dispatchQueue = DispatchQueue()
        dispatchQueue?.async {
          session.inputStream?.delegate = self;
          session.outputStream?.delegate = self;
          session.inputStream?.schedule(in: .current, forMode: .default)
          session.outputStream?.schedule(in: .current, forMode: .default)
          session.inputStream?.open()
          session.outputStream?.open()
          RunLoop.current.run()
        }