Skip to content

Commit d73d3b3

Browse files
authored
fixed rc.5 breaks in hummingbird example (#6)
1 parent 22be44d commit d73d3b3

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

Examples/HummingbirdDemo/Package.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ let package = Package(
1010
.executable(name: "App", targets: ["App"]),
1111
],
1212
dependencies: [
13-
.package(url: "https://github.com/hummingbird-project/hummingbird.git", from: "2.0.0-rc.1"),
14-
.package(url: "https://github.com/hummingbird-community/hummingbird-elementary.git", from: "0.1.0-rc.1"),
13+
.package(url: "https://github.com/hummingbird-project/hummingbird.git", from: "2.0.0-rc.5"),
14+
.package(url: "https://github.com/hummingbird-community/hummingbird-elementary.git", from: "0.2.0-rc.1"),
1515
.package(path: "../../"),
1616
.package(url: "https://github.com/apple/swift-async-algorithms", from: "1.0.0"),
1717
.package(url: "https://github.com/swift-server/swift-service-lifecycle.git", from: "2.0.0"),

Examples/HummingbirdDemo/Sources/App/Routes.swift

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,13 @@ func addRoutes(to router: Router<some RequestContext>) {
1111
}
1212
}
1313

14-
router.get("/time") { _, context in
14+
router.get("/time") { _, _ in
1515
Response(
1616
status: .ok,
1717
headers: [.contentType: "text/event-stream"],
1818
body: .init { writer in
1919
while true {
20-
try await writer.write(context.allocator.buffer(
21-
string: "data: \(TimeHeading().render())\n\n"))
20+
try await writer.write(ByteBuffer(string: "data: \(TimeHeading().render())\n\n"))
2221
try await Task.sleep(for: .seconds(1))
2322
}
2423
}

0 commit comments

Comments
 (0)