Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix runtime checks for RSocketRequestHandlerBuilder #119

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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