本文整理了Java中io.rsocket.Frame.toString()
方法的一些代码示例,展示了Frame.toString()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Frame.toString()
方法的具体详情如下:
包路径:io.rsocket.Frame
类名称: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());
内容来源于网络,如有侵权,请联系作者删除!