Exemplo n.º 1
0
    HttpActorAdapter(
        ActorRef<? super HttpRequest> userActor,
        Context actorContext,
        String httpResponseEncoderName) {
      super("HttpActorAdapter", new HttpChannelAdapter(actorContext, httpResponseEncoderName));

      if (actorContext.watch()) ((HttpChannelAdapter) (SendPort) getMailbox()).actor = this;

      this.userActor = userActor;
      this.context = actorContext;
    }
Exemplo n.º 2
0
    final void service(ChannelHandlerContext ctx, FullHttpRequest req) throws SuspendExecution {
      if (context.watch()) watchToken = watch(userActor);

      this.ctx = ctx;
      this.req = req;

      if (isDone()) {
        handleDeath(getDeathCause());
        return;
      }

      userActor.send(new HttpRequestWrapper(ref(), ctx, req));
    }