Skip to content

Commit

Permalink
Fix runtime checks for RSocketRequestHandlerBuilder (#119)
Browse files Browse the repository at this point in the history
  • Loading branch information
mareklangiewicz authored Nov 23, 2020
1 parent 3e6ab7b commit a56c2ea
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,22 +34,22 @@ class RSocketRequestHandlerBuilder internal constructor() {
}

public fun fireAndForget(block: (suspend RSocket.(payload: Payload) -> Unit)) {
check(metadataPush == null) { "Fire and Forget handler already configured" }
check(fireAndForget == null) { "Fire and Forget handler already configured" }
fireAndForget = block
}

public fun requestResponse(block: (suspend RSocket.(payload: Payload) -> Payload)) {
check(metadataPush == null) { "Request Response Push handler already configured" }
check(requestResponse == null) { "Request Response handler already configured" }
requestResponse = block
}

public fun requestStream(block: (RSocket.(payload: Payload) -> Flow<Payload>)) {
check(metadataPush == null) { "Request Stream handler already configured" }
check(requestStream == null) { "Request Stream handler already configured" }
requestStream = block
}

public fun requestChannel(block: (RSocket.(payloads: Flow<Payload>) -> Flow<Payload>)) {
check(metadataPush == null) { "Request Channel handler already configured" }
check(requestChannel == null) { "Request Channel handler already configured" }
requestChannel = block
}

Expand Down

0 comments on commit a56c2ea

Please sign in to comment.