-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
59 changed files
with
985 additions
and
522 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,20 @@ | ||
group=com.jauntsdn.rsocket | ||
version=1.0.0 | ||
version=1.1.0 | ||
|
||
dependencyManagementPluginVersion=1.0.11.RELEASE | ||
protobufPluginVersion=0.8.17 | ||
googleJavaFormatPluginVersion=0.9 | ||
gitPluginVersion=0.12.3 | ||
versionsPluginVersion=0.39.0 | ||
|
||
nettyBomVersion=4.1.69.Final | ||
nettyBomVersion=4.1.72.Final | ||
reactorBomVersion=Dysprosium-SR22 | ||
rxjavaVersion=3.1.2 | ||
rxjavaVersion=3.1.3 | ||
helidonCommonReactiveVersion=2.3.4 | ||
jsr305Version=3.0.2 | ||
javaxInjectVersion=1 | ||
javaxAnnotationVersion=1.3.2 | ||
protobufVersion=3.19.0 | ||
protobufVersion=3.19.1 | ||
|
||
org.gradle.parallel=true | ||
org.gradle.configureondemand=true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
# This is a Gradle generated file for dependency locking. | ||
# Manual edits can break the build and are not advised. | ||
# This file is expected to be part of source control. | ||
io.netty:netty-bom:4.1.69.Final | ||
io.netty:netty-bom:4.1.72.Final | ||
io.projectreactor:reactor-bom:Dysprosium-SR22 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
35 changes: 13 additions & 22 deletions
35
rsocket-helidon/src/main/java/com/jauntsdn/rsocket/ClientAcceptor.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,36 +1,27 @@ | ||
/* | ||
* Copyright 2020 - present Maksym Ostroverkhov. | ||
* Copyright 2021 - present Maksym Ostroverkhov. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package com.jauntsdn.rsocket; | ||
|
||
import java.util.function.Function; | ||
|
||
/** | ||
* {@code RSocket} is a full duplex protocol where a client and server are identical in terms of | ||
* both having the capability to initiate requests to their peer. This interface provides the | ||
* contract where a client accepts a new {@code RSocket} for sending requests to the peer and | ||
* returns a new {@code RSocket} that will be used to accept requests from it's peer. | ||
*/ | ||
public interface ClientAcceptor { | ||
|
||
/** | ||
* Accepts a new {@code RSocket} used to send requests to the peer and returns another {@code | ||
* RSocket} that is used for accepting requests from the peer. | ||
* | ||
* @param setup Setup as sent by the client. | ||
* @param requesterRSocket RSocket used to send requests to the peer. | ||
* @return RSocket to accept requests from the peer. | ||
*/ | ||
RSocket accept(SetupMessage setup, RSocket requesterRSocket); | ||
|
||
/** | ||
* Contract to decorate a {@link ClientAcceptor}, providing access to connection {@code setup} | ||
* information and the ability to also decorate the sockets for requesting and responding. | ||
* | ||
* <p>This can be used as an alternative to individual requester and responder {@link | ||
* RSocket.Interceptor} | ||
*/ | ||
@FunctionalInterface | ||
interface Interceptor extends Function<ClientAcceptor, ClientAcceptor> {} | ||
} |
22 changes: 22 additions & 0 deletions
22
rsocket-helidon/src/main/java/com/jauntsdn/rsocket/ClientStreamsAcceptor.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
/* | ||
* Copyright 2020 - present Maksym Ostroverkhov. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package com.jauntsdn.rsocket; | ||
|
||
public interface ClientStreamsAcceptor { | ||
|
||
MessageStreams accept(SetupMessage setup, MessageStreams requester); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
47 changes: 47 additions & 0 deletions
47
rsocket-helidon/src/main/java/com/jauntsdn/rsocket/MessageStreams.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
/* | ||
* Copyright 2020 - present Maksym Ostroverkhov. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package com.jauntsdn.rsocket; | ||
|
||
import io.helidon.common.reactive.Multi; | ||
import io.helidon.common.reactive.Single; | ||
import io.netty.buffer.ByteBufAllocator; | ||
import java.util.Optional; | ||
import java.util.concurrent.Flow; | ||
import java.util.concurrent.ScheduledExecutorService; | ||
|
||
public interface MessageStreams extends Closeable { | ||
|
||
Single<Void> fireAndForget(Message message); | ||
|
||
Single<Message> requestResponse(Message message); | ||
|
||
Multi<Message> requestStream(Message message); | ||
|
||
Multi<Message> requestChannel(Flow.Publisher<Message> messages); | ||
|
||
default Optional<Message.Factory> messageFactory() { | ||
return Optional.empty(); | ||
} | ||
|
||
default Optional<ScheduledExecutorService> scheduler() { | ||
return Optional.empty(); | ||
} | ||
|
||
default Optional<ByteBufAllocator> allocator() { | ||
return Optional.empty(); | ||
} | ||
} |
27 changes: 27 additions & 0 deletions
27
rsocket-helidon/src/main/java/com/jauntsdn/rsocket/MessageStreamsHandler.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
/* | ||
* Copyright 2020 - present Maksym Ostroverkhov. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package com.jauntsdn.rsocket; | ||
|
||
import io.helidon.common.reactive.Multi; | ||
import java.util.concurrent.Flow; | ||
|
||
public interface MessageStreamsHandler extends MessageStreams { | ||
|
||
default Multi<Message> requestChannel(Message message, Flow.Publisher<Message> messages) { | ||
return requestChannel(messages); | ||
} | ||
} |
Oops, something went wrong.