package io.tetrapod.core.rpc;

/**
 * Allows executing an async task and then responding to a pending request
 */
public class AsyncResponder {
   private final SessionRequestContext ctx;

   public AsyncResponder(RequestContext ctx) {
      this.ctx = (SessionRequestContext) ctx;
   }

   public void respondWith(Response res) {
      if (ctx.session != null) {
         ctx.session.sendResponse(res, ctx.header.requestId);
      }
   }

}

@@ -334,60 +334,25 @@
     
-if (ctx.session != null) %7B%0A         ctx.session.send
+ctx.handlePending
 Resp
@@ -388,16 +388,8 @@
 d);%0A
-      %7D%0A
    %7D

make asyncresponder work with internal request context too