gavioto
gavioto

Reputation: 1745

Create UDP Server Actor as class field or local variable in a Play controller?

I should send and wait for response using an UDP server from a Play controller. Where is the correct place to create de Actor? Local Variable or Object property?

This question come to my mind because working with play, when I change code in the actor Play re-compiles (I'm using play debug ~run), but changes are not applied, so I think I may be doing something wrong.

My actual code:

public class Application extends Controller {
  static final ActorRef server = Akka.system().actorOf(Props.create(Listener.class));
    
  public static Result index() {
    // ActorRef sender = Akka.system().actorOf(Props.create(SimpleSender.class));

Upvotes: 1

Views: 325

Answers (0)

Related Questions