Skip to content

Commit

Permalink
refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
nghialv committed Mar 27, 2015
1 parent 2d830c7 commit a8dacf5
Show file tree
Hide file tree
Showing 5 changed files with 43 additions and 21 deletions.
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,11 @@
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "../Transporter/DownloadTask.swift"
timestampString = "449078248.940804"
timestampString = "449109269.688164"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "27"
endingLineNumber = "27"
startingLineNumber = "28"
endingLineNumber = "28"
landmarkName = "resume()"
landmarkType = "5">
</BreakpointContent>
Expand Down Expand Up @@ -90,11 +90,11 @@
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "../Transporter/TPTaskGroup.swift"
timestampString = "449108477.898962"
timestampString = "449109411.380132"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "123"
endingLineNumber = "123"
startingLineNumber = "125"
endingLineNumber = "125"
landmarkName = "URLSession(_:task:didCompleteWithError:)"
landmarkType = "5">
</BreakpointContent>
Expand All @@ -106,11 +106,11 @@
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "../Transporter/TPTaskGroup.swift"
timestampString = "449108477.898962"
timestampString = "449109411.380132"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "128"
endingLineNumber = "128"
startingLineNumber = "130"
endingLineNumber = "130"
landmarkName = "TPTaskGroup"
landmarkType = "3">
</BreakpointContent>
Expand All @@ -122,11 +122,11 @@
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "../Transporter/TPTaskGroup.swift"
timestampString = "449108477.898962"
timestampString = "449109411.380132"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "132"
endingLineNumber = "132"
startingLineNumber = "134"
endingLineNumber = "134"
landmarkName = "URLSession(_:task:didSendBodyData:totalBytesSent:totalBytesExpectedToSend:)"
landmarkType = "5">
</BreakpointContent>
Expand All @@ -138,11 +138,11 @@
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "../Transporter/TPTaskGroup.swift"
timestampString = "449108477.898962"
timestampString = "449109411.380132"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "140"
endingLineNumber = "140"
startingLineNumber = "142"
endingLineNumber = "142"
landmarkName = "URLSession(_:downloadTask:didResumeAtOffset:expectedTotalBytes:)"
landmarkType = "5">
</BreakpointContent>
Expand All @@ -154,14 +154,30 @@
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "../Transporter/TPTaskGroup.swift"
timestampString = "449108477.898962"
timestampString = "449109411.380132"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "145"
endingLineNumber = "145"
startingLineNumber = "147"
endingLineNumber = "147"
landmarkName = "URLSession(_:downloadTask:didWriteData:totalBytesWritten:totalBytesExpectedToWrite:)"
landmarkType = "5">
</BreakpointContent>
</BreakpointProxy>
<BreakpointProxy
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
<BreakpointContent
shouldBeEnabled = "No"
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "../Transporter/TPTaskGroup.swift"
timestampString = "449109245.636227"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "78"
endingLineNumber = "78"
landmarkName = "resume()"
landmarkType = "5">
</BreakpointContent>
</BreakpointProxy>
</Breakpoints>
</Bucket>
7 changes: 5 additions & 2 deletions Example/Example/ViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -63,14 +63,17 @@ class ViewController: UIViewController {
NSLog("transaction1: completed")
}
.push(task3)
.push([task5, task5])
.completed {
NSLog("transaction2: completed")
}
.push(tasks[2] --> tasks[3] --> tasks[4])
.push([task5, task5])
.completed {
NSLog("transaction3: completed")
}
.push(tasks[2] --> tasks[3] --> tasks[4])
.completed {
NSLog("transaction4: completed")
}
.resume()
}
}
1 change: 1 addition & 0 deletions Transporter/DownloadTask.swift
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ public class DownloadTask : TPTransferTask {
}

public override func resume() {
NSLog("download task did resume")
task?.resume()
}
}
4 changes: 3 additions & 1 deletion Transporter/TPTaskGroup.swift
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,9 @@ public class TPTaskGroup : TPTask {
private func createSession() -> NSURLSession {
let identifier = NSUUID().UUIDString
let configuration = NSURLSessionConfiguration.backgroundSessionConfigurationWithIdentifier(identifier)
return NSURLSession(configuration: configuration, delegate: self, delegateQueue: nil)
configuration.HTTPMaximumConnectionsPerHost = 5
let session = NSURLSession(configuration: configuration, delegate: self, delegateQueue: nil)
return session
}
}

Expand Down

0 comments on commit a8dacf5

Please sign in to comment.