Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@gmethvin
Copy link
Member

This makes sure the Netty server always uses Akka's ExecutionContext to execute actions (like we did in 2.4.x), rather than using the Netty thread.

/cc @jroper

@schmitch
Copy link
Contributor

schmitch commented Oct 27, 2016

Shouldn't we add a test where we create a EssentialAction/EssentialFilter:

  def index = EssentialAction { rh =>
    Accumulator.done(Ok(Thread.currentThread().getName))
  }

while before it was netty-event-loop-NUMBER and now it will be application-akka.actor.default-dispatcher-NUMBER?

And another question might also remain, if we change the ExecutionContext to Trampoline inside the Action (DefaultActionBuilder instead of relying on a user passed one?) / Filter Code, since I guess else it will switch Threads more than necessary? Guess the best way would be merging it and check if there is a "serious" performance hit in prune!?

@gmethvin
Copy link
Member Author

@schmitch Yeah, we can see what prune says. I think we try to avoid thread switching already using trampoline in most places, which is how we ran into this problem in the first place.

I'll add a test as well to make sure the right thread is being used.

@wsargent
Copy link
Member

LGTM

@wsargent wsargent merged commit 09c1a20 into playframework:master Oct 28, 2016
@gmethvin gmethvin deleted the use-akka-ec branch October 28, 2016 22:49
@mkurz mkurz added this to the 2.5.10 milestone Dec 6, 2016
@schmitch schmitch mentioned this pull request Feb 9, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants