本文整理汇总了Java中io.rsocket.RSocket类的典型用法代码示例。如果您正苦于以下问题:Java RSocket类的具体用法?Java RSocket怎么用?Java RSocket使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
RSocket类属于io.rsocket包,在下文中一共展示了RSocket类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: ping
import io.rsocket.RSocket; //导入依赖的package包/类
private static void ping(int count, RSocket rSocket) {
System.out.println("starting -> " + count);
SimpleMeterRegistry registry = new SimpleMeterRegistry();
SimpleServiceClient client = new SimpleServiceClient(rSocket, registry);
long start = System.nanoTime();
SimpleRequest request = SimpleRequest.newBuilder().setRequestMessage("hello").build();
Flux.range(1, count)
.flatMap(
i -> client.requestReply(request), 16)
.blockLast();
double completedMillis = (System.nanoTime() - start) / 1_000_000d;
double rps = count / ((System.nanoTime() - start) / 1_000_000_000d);
System.out.println("test complete in " + completedMillis + "ms");
System.out.println("test rps " + rps);
Timer timer = registry.find("proteus.client.latency").tags("method", "requestReply").timer().get();
System.out.println("p50: " + timer.percentile(0.50, TimeUnit.MILLISECONDS) + "ms");
System.out.println("p90: " + timer.percentile(0.90, TimeUnit.MILLISECONDS) + "ms");
System.out.println("p99: " + timer.percentile(0.99, TimeUnit.MILLISECONDS) + "ms");
System.out.println("p99.9: " + timer.percentile(0.999, TimeUnit.MILLISECONDS) + "ms");
System.out.println("max: " + timer.max(TimeUnit.MILLISECONDS) + "ms");
System.out.println();
}
示例2: accept
import io.rsocket.RSocket; //导入依赖的package包/类
@Override
public Mono<RSocket> accept(ConnectionSetupPayload connectionSetupPayload, RSocket rSocket) {
logger.info("Receiving connection");
return Mono.just(handler);
}
示例3: ReactiveSocketClient
import io.rsocket.RSocket; //导入依赖的package包/类
public ReactiveSocketClient(RSocket socket){
initDefaultConverters();
this.socket = socket;
}
示例4: AbstractRemoteHandler
import io.rsocket.RSocket; //导入依赖的package包/类
public AbstractRemoteHandler(RSocket socket, ServiceMethodInfo info) {
this.socket = socket;
this.info = info;
}
示例5: RequestStreamRemoteHandler
import io.rsocket.RSocket; //导入依赖的package包/类
public RequestStreamRemoteHandler(RSocket socket, ServiceMethodInfo info) {
super(socket, info);
}
示例6: OneWayRemoteHandler
import io.rsocket.RSocket; //导入依赖的package包/类
public OneWayRemoteHandler(RSocket socket, ServiceMethodInfo info) {
super(socket, info);
}
示例7: RequestOneRemoteHandler
import io.rsocket.RSocket; //导入依赖的package包/类
public RequestOneRemoteHandler(RSocket socket, ServiceMethodInfo info) {
super(socket, info);
}
示例8: RequestManyRemoteHandler
import io.rsocket.RSocket; //导入依赖的package包/类
public RequestManyRemoteHandler(RSocket socket, ServiceMethodInfo info) {
super(socket, info);
}
示例9: invoke
import io.rsocket.RSocket; //导入依赖的package包/类
Mono<RSocket> invoke(MethodHandler methodHandler);