io.rsocket.Frame.toString()方法的使用及代码示例

x33g5p2x  于2022-01-19 转载在 其他  
字(4.3k)|赞(0)|评价(0)|浏览(122)

本文整理了Java中io.rsocket.Frame.toString()方法的一些代码示例,展示了Frame.toString()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Frame.toString()方法的具体详情如下:
包路径:io.rsocket.Frame
类名称:Frame
方法名:toString

Frame.toString介绍

暂无

代码示例

代码示例来源:origin: rsocket/rsocket-java

@Override
public Mono<Void> sendOne(Frame frame) {
 if (debugEnabled) {
  LOGGER.debug("sending -> " + frame.toString());
 }
 return source.sendOne(frame);
}

代码示例来源:origin: rsocket/rsocket-java

@Override
public Flux<Frame> receive() {
 return processor.flatMapMany(
   f -> {
    if (debugEnabled) {
     return f.doOnNext(frame -> LOGGER.debug("receiving -> " + frame.toString()));
    } else {
     return f;
    }
   });
}

代码示例来源:origin: rsocket/rsocket-java

@Override
public Mono<Void> send(Publisher<Frame> frame) {
 if (debugEnabled) {
  frame = Flux.from(frame).doOnNext(f -> LOGGER.debug("sending -> " + f.toString()));
 }
 return source.send(frame);
}

代码示例来源:origin: rsocket/rsocket-java

@Override
public Flux<Frame> receive() {
 return receive.doOnNext(f -> System.out.println(name + " - " + f.toString()));
}

代码示例来源:origin: rsocket/rsocket-java

private void handleStreamZero(FrameType type, Frame frame) {
 switch (type) {
  case ERROR:
   RuntimeException error = Exceptions.from(frame);
   lifecycle.setTerminationError(error);
   errorConsumer.accept(error);
   connection.dispose();
   break;
  case LEASE:
   break;
  case KEEPALIVE:
   if (keepAliveHandler != null) {
    keepAliveHandler.receive(frame);
   }
   break;
  default:
   // Ignore unknown frames. Throwing an error will close the socket.
   errorConsumer.accept(
     new IllegalStateException(
       "Client received supported frame on stream 0: " + frame.toString()));
 }
}

代码示例来源:origin: rsocket/rsocket-java

default:
 throw new IllegalStateException(
   "Client received supported frame on stream " + streamId + ": " + frame.toString());

代码示例来源:origin: rsocket/rsocket-java

@Test
 public void testPayload() {
  Frame frame =
    Frame.PayloadFrame.from(
      1,
      FrameType.NEXT_COMPLETE,
      DefaultPayload.create("Hello"),
      FrameHeaderFlyweight.FLAGS_C);
  frame.toString();
 }
}

代码示例来源:origin: rsocket/rsocket-java

@Test
public void testFrameToString() {
 final Frame requestFrame =
   Frame.Request.from(
     1, FrameType.REQUEST_RESPONSE, DefaultPayload.create("streaming in -> 0"), 1);
 assertEquals(
   "Frame => Stream ID: 1 Type: REQUEST_RESPONSE Payload: data: \"streaming in -> 0\" ",
   requestFrame.toString());
}

代码示例来源:origin: rsocket/rsocket-java

@Override
public Mono<Void> send(Publisher<Frame> frame) {
 return Flux.from(frame)
   .doOnNext(f -> System.out.println(name + " - " + f.toString()))
   .doOnNext(send::onNext)
   .doOnError(send::onError)
   .then();
}

代码示例来源:origin: rsocket/rsocket-java

@Test
public void testFrameWithMetadataToString() {
 final Frame requestFrame =
   Frame.Request.from(
     1,
     FrameType.REQUEST_RESPONSE,
     DefaultPayload.create("streaming in -> 0", "metadata"),
     1);
 assertEquals(
   "Frame => Stream ID: 1 Type: REQUEST_RESPONSE Payload: metadata: \"metadata\" data: \"streaming in -> 0\" ",
   requestFrame.toString());
}

代码示例来源:origin: io.rsocket/rsocket-core

@Override
public Mono<Void> sendOne(Frame frame) {
 if (debugEnabled) {
  LOGGER.debug("sending -> " + frame.toString());
 }
 return source.sendOne(frame);
}

代码示例来源:origin: io.rsocket/rsocket-core

@Override
public Flux<Frame> receive() {
 return processor.flatMapMany(
   f -> {
    if (debugEnabled) {
     return f.doOnNext(frame -> LOGGER.debug("receiving -> " + frame.toString()));
    } else {
     return f;
    }
   });
}

代码示例来源:origin: io.rsocket/rsocket-core

@Override
public Mono<Void> send(Publisher<Frame> frame) {
 if (debugEnabled) {
  frame = Flux.from(frame).doOnNext(f -> LOGGER.debug("sending -> " + f.toString()));
 }
 return source.send(frame);
}

代码示例来源:origin: io.rsocket/rsocket-core

private void handleStreamZero(FrameType type, Frame frame) {
 switch (type) {
  case ERROR:
   RuntimeException error = Exceptions.from(frame);
   lifecycle.setTerminationError(error);
   errorConsumer.accept(error);
   connection.dispose();
   break;
  case LEASE:
   break;
  case KEEPALIVE:
   if (keepAliveHandler != null) {
    keepAliveHandler.receive(frame);
   }
   break;
  default:
   // Ignore unknown frames. Throwing an error will close the socket.
   errorConsumer.accept(
     new IllegalStateException(
       "Client received supported frame on stream 0: " + frame.toString()));
 }
}

代码示例来源:origin: io.rsocket/rsocket-core

default:
 throw new IllegalStateException(
   "Client received supported frame on stream " + streamId + ": " + frame.toString());

相关文章