Skip to content

Commit

Permalink
Merge pull request #386 from scalecube/cleanup_cluster_api_from_trans…
Browse files Browse the repository at this point in the history
…port_api

Removed transport api from Cluster interface
  • Loading branch information
artem-v committed Aug 31, 2023
2 parents bd22533 + 5c03268 commit ced3c81
Show file tree
Hide file tree
Showing 5 changed files with 0 additions and 244 deletions.
42 changes: 0 additions & 42 deletions cluster-api/src/main/java/io/scalecube/cluster/Cluster.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,48 +16,6 @@ public interface Cluster {
*/
Address address();

/**
* Send a msg from this member (src) to target member (specified in parameters).
*
* @param member target member
* @param message msg
* @return promise telling success or failure
*/
Mono<Void> send(Member member, Message message);

/**
* Send a msg from this member (src) to target member (specified in parameters).
*
* @param address target address
* @param message msg
* @return promise telling success or failure
*/
Mono<Void> send(Address address, Message message);

/**
* Sends message to the given address. It will issue connect in case if no transport channel by
* given transport {@code address} exists already. Send is an async operation and expecting a
* response by a provided correlationId and sender address of the caller.
*
* @param address address where message will be sent
* @param request to send message must contain correlctionId and sender to handle reply.
* @return promise which will be completed with result of sending (message or exception)
* @throws IllegalArgumentException if {@code message} or {@code address} is null
*/
Mono<Message> requestResponse(Address address, Message request);

/**
* Sends message to the given address. It will issue connect in case if no transport channel by
* given transport {@code address} exists already. Send is an async operation and expecting a
* response by a provided correlationId and sender address of the caller.
*
* @param member where message will be sent
* @param request to send message must contain correlctionId and sender to handle reply.
* @return promise which will be completed with result of sending (message or exception)
* @throws IllegalArgumentException if {@code message} or {@code address} is null
*/
Mono<Message> requestResponse(Member member, Message request);

/**
* Spreads given message between cluster members using gossiping protocol.
*
Expand Down
20 changes: 0 additions & 20 deletions cluster/src/main/java/io/scalecube/cluster/ClusterImpl.java
Original file line number Diff line number Diff line change
Expand Up @@ -389,26 +389,6 @@ public Address address() {
return member().address();
}

@Override
public Mono<Void> send(Member member, Message message) {
return send(member.address(), message);
}

@Override
public Mono<Void> send(Address address, Message message) {
return transport.send(address, message);
}

@Override
public Mono<Message> requestResponse(Address address, Message request) {
return transport.requestResponse(address, request);
}

@Override
public Mono<Message> requestResponse(Member member, Message request) {
return transport.requestResponse(member.address(), request);
}

@Override
public Mono<String> spreadGossip(Message message) {
return gossip.spread(message);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
import io.scalecube.transport.netty.tcp.TcpTransportFactory;
import java.util.Collections;
import java.util.Optional;
import java.util.concurrent.TimeUnit;

/**
* Using Cluster metadata: metadata is set of custom parameters that may be used by application
Expand Down Expand Up @@ -49,18 +48,5 @@ public void onMessage(Message message) {

System.err.println("### joeMemberOptional: " + joeMemberOptional);
System.err.println("### joeMetadata: " + alice.metadata(joeMemberOptional.get()));

// Send hello to Joe
joeMemberOptional.ifPresent(
member ->
alice
.send(member, Message.withData("Hello Joe").build())
.subscribe(
null,
ex -> {
// no-op
}));

TimeUnit.SECONDS.sleep(3);
}
}
84 changes: 0 additions & 84 deletions examples/src/main/java/io/scalecube/examples/MessagingExample.java

This file was deleted.

This file was deleted.

0 comments on commit ced3c81

Please sign in to comment.