Michael
Michael

Reputation: 10303

How to check if actor is running in Scala application?

Suppose I have a running Scala application with actors. I suspect one actor does not work, i.e. either it exited or it is "stuck" or it is running in a loop.

Now I would like to know what is exactly going on with the actor. Is there any way in Scala to check actors/their mailboxes from the outside of the application, e.g. with JMX ?

I guess if an actor exited because of an uncaught Throwable the Scala actor library always writes this in the log. Is it correct? I can check also if an actor is stuck using a JVM thread dump.

What else can I use to check if my actor is running?

Upvotes: 1

Views: 314

Answers (1)

Kim Stebel
Kim Stebel

Reputation: 42047

You can call the getState method.

Upvotes: 1

Related Questions