当前位置: 首页>>代码示例>>Java>>正文


Java RSocket类代码示例

本文整理汇总了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();
}
 
开发者ID:netifi,项目名称:proteus-java,代码行数:23,代码来源:Ping.java

示例2: accept

import io.rsocket.RSocket; //导入依赖的package包/类
@Override
public Mono<RSocket> accept(ConnectionSetupPayload connectionSetupPayload, RSocket rSocket) {
	logger.info("Receiving connection");
	return Mono.just(handler);
}
 
开发者ID:viniciusccarvalho,项目名称:spring-cloud-sockets,代码行数:6,代码来源:DispatchSocketAcceptor.java

示例3: ReactiveSocketClient

import io.rsocket.RSocket; //导入依赖的package包/类
public ReactiveSocketClient(RSocket socket){
	initDefaultConverters();
	this.socket = socket;
}
 
开发者ID:viniciusccarvalho,项目名称:spring-cloud-sockets,代码行数:5,代码来源:ReactiveSocketClient.java

示例4: AbstractRemoteHandler

import io.rsocket.RSocket; //导入依赖的package包/类
public AbstractRemoteHandler(RSocket socket, ServiceMethodInfo info) {
	this.socket = socket;
	this.info = info;
}
 
开发者ID:viniciusccarvalho,项目名称:spring-cloud-sockets,代码行数:5,代码来源:AbstractRemoteHandler.java

示例5: RequestStreamRemoteHandler

import io.rsocket.RSocket; //导入依赖的package包/类
public RequestStreamRemoteHandler(RSocket socket, ServiceMethodInfo info) {
	super(socket, info);
}
 
开发者ID:viniciusccarvalho,项目名称:spring-cloud-sockets,代码行数:4,代码来源:RequestStreamRemoteHandler.java

示例6: OneWayRemoteHandler

import io.rsocket.RSocket; //导入依赖的package包/类
public OneWayRemoteHandler(RSocket socket, ServiceMethodInfo info) {
	super(socket, info);
}
 
开发者ID:viniciusccarvalho,项目名称:spring-cloud-sockets,代码行数:4,代码来源:OneWayRemoteHandler.java

示例7: RequestOneRemoteHandler

import io.rsocket.RSocket; //导入依赖的package包/类
public RequestOneRemoteHandler(RSocket socket, ServiceMethodInfo info) {
	super(socket, info);
}
 
开发者ID:viniciusccarvalho,项目名称:spring-cloud-sockets,代码行数:4,代码来源:RequestOneRemoteHandler.java

示例8: RequestManyRemoteHandler

import io.rsocket.RSocket; //导入依赖的package包/类
public RequestManyRemoteHandler(RSocket socket, ServiceMethodInfo info) {
	super(socket, info);
}
 
开发者ID:viniciusccarvalho,项目名称:spring-cloud-sockets,代码行数:4,代码来源:RequestManyRemoteHandler.java

示例9: invoke

import io.rsocket.RSocket; //导入依赖的package包/类
Mono<RSocket> invoke(MethodHandler methodHandler); 
开发者ID:viniciusccarvalho,项目名称:spring-cloud-sockets,代码行数:2,代码来源:ReactiveSocketHandler.java


注:本文中的io.rsocket.RSocket类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。