Changeset b5497ef
- Timestamp:
- Sep 30, 2018 11:02:28 AM (2 years ago)
- Branches:
- master
- Children:
- 410f9df
- Parents:
- 2233f7f
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
launchers/macosx/I2PLauncher/userinterface/LogViewController.swift
r2233f7f rb5497ef 37 37 let output = self.outputPipe?.fileHandleForReading.availableData 38 38 let outputString = String(data: output!, encoding: String.Encoding.utf8) ?? "" 39 40 DispatchQueue.main.async(execute: { 39 let workTask = DispatchWorkItem { 41 40 let previousOutput = self.textFieldView?.string ?? "" 42 41 let nextOutput = previousOutput + "\n" + outputString … … 45 44 let range = NSRange(location:nextOutput.characters.count,length:0) 46 45 self.textFieldView?.scrollRangeToVisible(range) 47 46 } 47 DispatchQueue.main.async(execute: workTask) 48 49 // When router stop, stop the stream as well. If not it will go wild and create high cpu load 50 RouterManager.shared().eventManager.listenTo(eventName: "router_stop", action: { 51 NSLog("Time to cancel stream!") 52 workTask.cancel() 48 53 }) 54 49 55 50 56 self.outputPipe?.fileHandleForReading.waitForDataInBackgroundAndNotify()
Note: See TracChangeset
for help on using the changeset viewer.