Skip to content

Commit

Permalink
Merge pull request #29 from noppoMan/swift-2016-05-09
Browse files Browse the repository at this point in the history
Swift 2016-05-09
  • Loading branch information
noppoMan committed May 10, 2016
2 parents 004561e + 1ad82dd commit b3d41de
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 9 deletions.
8 changes: 4 additions & 4 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ import PackageDescription
let package = Package(
name: "Slimane",
dependencies: [
.Package(url: "https://github.com/slimane-swift/Middleware.git", majorVersion: 0, minor: 2),
.Package(url: "https://github.com/slimane-swift/Skelton.git", majorVersion: 0, minor: 4),
.Package(url: "https://github.com/slimane-swift/Middleware.git", majorVersion: 0, minor: 3),
.Package(url: "https://github.com/slimane-swift/Skelton.git", majorVersion: 0, minor: 5),
.Package(url: "https://github.com/slimane-swift/Time.git", majorVersion: 0, minor: 2),
.Package(url: "https://github.com/slimane-swift/POSIXRegex.git", majorVersion: 0, minor: 6),
.Package(url: "https://github.com/slimane-swift/AsyncResponderConvertible.git", majorVersion: 0, minor: 2),
.Package(url: "https://github.com/slimane-swift/POSIXRegex.git", majorVersion: 0, minor: 7),
.Package(url: "https://github.com/slimane-swift/AsyncResponderConvertible.git", majorVersion: 0, minor: 3),
]
)
2 changes: 1 addition & 1 deletion Sources/AsyncRoute.swift
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public protocol AsyncRoute: AsyncResponder {
}

extension AsyncRoute {
public func respond(to request: Request, result: (Void throws -> Response) -> Void) {
public func respond(to request: Request, result: ((Void) throws -> Response) -> Void) {
result {
Response(status: .ok)
}
Expand Down
2 changes: 1 addition & 1 deletion Sources/AsyncRouter.swift
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public struct Router: AsyncRouter {
self.respond = respond
}

public func respond(to request: Request, result: (Void throws -> Response) -> Void) {
public func respond(to request: Request, result: ((Void) throws -> Response) -> Void) {
return self.respond(to: request, result: result)
}

Expand Down
4 changes: 2 additions & 2 deletions Sources/Slimane+Server.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
//

extension Slimane {
public func listen(loop: Loop = Loop.defaultLoop, host: String = "0.0.0.0", port: Int = 3000, errorHandler: ErrorProtocol -> () = { _ in }) throws {
var server = HTTPServer(loop: loop, ipcEnable: Cluster.isWorker) { [unowned self] in
public func listen(loop: Loop = Loop.defaultLoop, host: String = "0.0.0.0", port: Int = 3000, errorHandler: (ErrorProtocol) -> () = { _ in }) throws {
let server = HTTPServer(loop: loop, ipcEnable: Cluster.isWorker) { [unowned self] in
do {
let (request, stream) = try $0()
self.dispatch(request, stream: stream)
Expand Down
2 changes: 1 addition & 1 deletion Sources/Slimane.swift
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public class Slimane {

public var backlog: UInt = 1024

public var errorHandler: ErrorProtocol -> Response = defaultErrorHandler
public var errorHandler: (ErrorProtocol) -> Response = defaultErrorHandler

// TODO This is interim measures for handle streaming response
// untill https://github.com/open-swift/S4/pull/52 get merged.
Expand Down

0 comments on commit b3d41de

Please sign in to comment.