Never mind, I think I have realised that this is not the appropriate model
for programming with Netty.
Rogan
On Wednesday, August 23, 2017 at 5:00:51 PM UTC+2, Rogan Dawes wrote:
>
> Hi,
>
> I'm trying to come up with a scheme to match responses to the original
> request, and trigger a Future/Promise when the response is received.
>
> Conceptually, something like:
>
> Message m = new Message("Something");
> Future<Response> rf = m.future();
> rf.addListener(new FutureListener() {
> public void operationComplete(Future<Response> f) {
> if (f.isSuccess()) {
> Response r = f.get();
> // ... something with the response
> } else {
> // it failed
> }
> }
> });
> ctx.writeAndFlush(m);
>
> A ChannelHandler further along the pipeline will take care of matching the
> responses to the requests, and will trigger the future accordingly.
>
> I'm actually trying to implement a Modem handler, that will indicate
> whether the AT command was successfully executed or not, in case that helps
> add context.
>
> Any thoughts?
>
> Rogan
>
>
--
You received this message because you are subscribed to the Google Groups
"Netty discussions" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/netty/6be555d5-4a7a-4e7d-a6e3-dd7de84b4b48%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.