Skip to content

Commit 82c950e

Browse files
committed
Add send method with eventLoop argument
to avoid manual `hop(to:)` call
1 parent 21e25cc commit 82c950e

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

Sources/FCM/Helpers/FCM+SendMessage.swift

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,14 @@ import Vapor
33

44
extension FCM {
55
public func send(_ message: FCMMessageDefault) -> EventLoopFuture<String> {
6+
_send(message)
7+
}
8+
9+
public func send(_ message: FCMMessageDefault, on eventLoop: EventLoop) -> EventLoopFuture<String> {
10+
_send(message).hop(to: eventLoop)
11+
}
12+
13+
private func _send(_ message: FCMMessageDefault) -> EventLoopFuture<String> {
614
guard let configuration = self.configuration else {
715
fatalError("FCM not configured. Use app.fcm.configuration = ...")
816
}

0 commit comments

Comments
 (0)