You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to use rsocket-java in the zio. In the below code block receives the payload and returns the response payload.
//I couldn't run below code directlyfor {
_ <- ZIO.log("Request: " + payload.getDataUtf8)
} yield ()
//When I use like this it's okey but how to return from inside this block?Unsafe.unsafe { implicitunsafe => {
zio.Runtime.default.unsafe.run(
for {
_ <- ZIO.log("Request: " + payload.getDataUtf8)
task = payload.getDataUtf8.fromJson[MyTask]
} yield task
).getOrThrowFiberFailure()
}}
RSocketServer.create(SocketAcceptor.forRequestResponse(payload -> {
returnMono.just(DefaultPayload.create("Echo: " + payload.getDataUtf8())); // There is must be return given exact type
}))
This is called the callback function right? How to run zio effect in that. I want to run some zio effects and return response payload
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hi,
I'm trying to use rsocket-java in the zio. In the below code block receives the payload and returns the response payload.
This is called the callback function right? How to run zio effect in that. I want to run some zio effects and return response payload
Beta Was this translation helpful? Give feedback.
All reactions