Best practice for naming akka-actors (in the companion object)Discovery of Akka actors in clusterConfusion over Akka Actors vs Java Objectscreating Akka actor hierarchies lazilyHow do I create a TestActorRef in Scala for an Actor with constructor params?Akka - Common service actor: Identify or ExtensionAkka cluster-sharding: Can Entry actors have dynamic propsWhat are the implications of nesting an akka Actor class in an object to the members of the class?How do I create a “Locator” for Akka ActorsAkka and singleton actorsScala: How to extend an Akka actor?
Is exact Kanji stroke length important?
Unreliable Magic - Is it worth it?
Why Were Madagascar and New Zealand Discovered So Late?
How can I kill an app using Terminal?
CREATE opcode: what does it really do?
How to pronounce the slash sign
Do sorcerers' Subtle Spells require a skill check to be unseen?
How does Loki do this?
Escape a backup date in a file name
Is a stroke of luck acceptable after a series of unfavorable events?
How to draw lines on a tikz-cd diagram
What Brexit proposals are on the table in the indicative votes on the 27th of March 2019?
How to be diplomatic in refusing to write code that breaches the privacy of our users
Was Spock the First Vulcan in Starfleet?
How does it work when somebody invests in my business?
Is expanding the research of a group into machine learning as a PhD student risky?
What is the opposite of 'gravitas'?
How do I extract a value from a time formatted value in excel?
Customer Requests (Sometimes) Drive Me Bonkers!
Trouble understanding the speech of overseas colleagues
Increase performance creating Mandelbrot set in python
How can I get through very long and very dry, but also very useful technical documents when learning a new tool?
Anatomically Correct Strange Women In Ponds Distributing Swords
What happens if you roll doubles 3 times then land on "Go to jail?"
Best practice for naming akka-actors (in the companion object)
Discovery of Akka actors in clusterConfusion over Akka Actors vs Java Objectscreating Akka actor hierarchies lazilyHow do I create a TestActorRef in Scala for an Actor with constructor params?Akka - Common service actor: Identify or ExtensionAkka cluster-sharding: Can Entry actors have dynamic propsWhat are the implications of nesting an akka Actor class in an object to the members of the class?How do I create a “Locator” for Akka ActorsAkka and singleton actorsScala: How to extend an Akka actor?
I have several akka-actors defined like this:
object SomethingActor
val name: String = "somethingActor"
def props: Props = Props(new SomethingActor())
class somethingActor extends Actor
verride def receive: Receive = ???
// somewhere else
final val myActor = actorSystem.actorOf(SomethingActor.props, SomethingActor.name)
Of these actors, only up to one single instant is "alive" at any given moment of my application, so e.g. a new SomethingActor
actor can only be created if the old SomethingActor
is dead.
Now, I don't think defining the actor name like this: val name: String = "somethingActor"
is very nice, so I have been wondering if I can use something like this:
object SomethingActor
val name: String = this.getClass.getName
def props: Props = Props(new SomethingActor())
Would this be considered bad practice? Is there a better way to handle this? I (think I) need to save the name in the companion object to be able to search for the actor from another point in my program using ActorSystem.actorSelection(path: String)
(docu).
scala akka akka-actor
add a comment |
I have several akka-actors defined like this:
object SomethingActor
val name: String = "somethingActor"
def props: Props = Props(new SomethingActor())
class somethingActor extends Actor
verride def receive: Receive = ???
// somewhere else
final val myActor = actorSystem.actorOf(SomethingActor.props, SomethingActor.name)
Of these actors, only up to one single instant is "alive" at any given moment of my application, so e.g. a new SomethingActor
actor can only be created if the old SomethingActor
is dead.
Now, I don't think defining the actor name like this: val name: String = "somethingActor"
is very nice, so I have been wondering if I can use something like this:
object SomethingActor
val name: String = this.getClass.getName
def props: Props = Props(new SomethingActor())
Would this be considered bad practice? Is there a better way to handle this? I (think I) need to save the name in the companion object to be able to search for the actor from another point in my program using ActorSystem.actorSelection(path: String)
(docu).
scala akka akka-actor
I thinkthis.getClass.getName
is a good practice.Of these actors, only up to one single instant is alive at any given moment of my application
Kindly confirm the mentioned feature you want or not ?
– Shantiswarup Tunga
Mar 22 at 9:58
Of these actors, only up to one single instant is alive at any given moment of my application
This is the case in my application and I do not intend to change that. :)
– Florian Baierl
Mar 22 at 13:04
Then I think your approach is a good.
– Shantiswarup Tunga
Mar 22 at 17:14
add a comment |
I have several akka-actors defined like this:
object SomethingActor
val name: String = "somethingActor"
def props: Props = Props(new SomethingActor())
class somethingActor extends Actor
verride def receive: Receive = ???
// somewhere else
final val myActor = actorSystem.actorOf(SomethingActor.props, SomethingActor.name)
Of these actors, only up to one single instant is "alive" at any given moment of my application, so e.g. a new SomethingActor
actor can only be created if the old SomethingActor
is dead.
Now, I don't think defining the actor name like this: val name: String = "somethingActor"
is very nice, so I have been wondering if I can use something like this:
object SomethingActor
val name: String = this.getClass.getName
def props: Props = Props(new SomethingActor())
Would this be considered bad practice? Is there a better way to handle this? I (think I) need to save the name in the companion object to be able to search for the actor from another point in my program using ActorSystem.actorSelection(path: String)
(docu).
scala akka akka-actor
I have several akka-actors defined like this:
object SomethingActor
val name: String = "somethingActor"
def props: Props = Props(new SomethingActor())
class somethingActor extends Actor
verride def receive: Receive = ???
// somewhere else
final val myActor = actorSystem.actorOf(SomethingActor.props, SomethingActor.name)
Of these actors, only up to one single instant is "alive" at any given moment of my application, so e.g. a new SomethingActor
actor can only be created if the old SomethingActor
is dead.
Now, I don't think defining the actor name like this: val name: String = "somethingActor"
is very nice, so I have been wondering if I can use something like this:
object SomethingActor
val name: String = this.getClass.getName
def props: Props = Props(new SomethingActor())
Would this be considered bad practice? Is there a better way to handle this? I (think I) need to save the name in the companion object to be able to search for the actor from another point in my program using ActorSystem.actorSelection(path: String)
(docu).
scala akka akka-actor
scala akka akka-actor
asked Mar 21 at 15:59
Florian BaierlFlorian Baierl
7551829
7551829
I thinkthis.getClass.getName
is a good practice.Of these actors, only up to one single instant is alive at any given moment of my application
Kindly confirm the mentioned feature you want or not ?
– Shantiswarup Tunga
Mar 22 at 9:58
Of these actors, only up to one single instant is alive at any given moment of my application
This is the case in my application and I do not intend to change that. :)
– Florian Baierl
Mar 22 at 13:04
Then I think your approach is a good.
– Shantiswarup Tunga
Mar 22 at 17:14
add a comment |
I thinkthis.getClass.getName
is a good practice.Of these actors, only up to one single instant is alive at any given moment of my application
Kindly confirm the mentioned feature you want or not ?
– Shantiswarup Tunga
Mar 22 at 9:58
Of these actors, only up to one single instant is alive at any given moment of my application
This is the case in my application and I do not intend to change that. :)
– Florian Baierl
Mar 22 at 13:04
Then I think your approach is a good.
– Shantiswarup Tunga
Mar 22 at 17:14
I think
this.getClass.getName
is a good practice. Of these actors, only up to one single instant is alive at any given moment of my application
Kindly confirm the mentioned feature you want or not ?– Shantiswarup Tunga
Mar 22 at 9:58
I think
this.getClass.getName
is a good practice. Of these actors, only up to one single instant is alive at any given moment of my application
Kindly confirm the mentioned feature you want or not ?– Shantiswarup Tunga
Mar 22 at 9:58
Of these actors, only up to one single instant is alive at any given moment of my application
This is the case in my application and I do not intend to change that. :)– Florian Baierl
Mar 22 at 13:04
Of these actors, only up to one single instant is alive at any given moment of my application
This is the case in my application and I do not intend to change that. :)– Florian Baierl
Mar 22 at 13:04
Then I think your approach is a good.
– Shantiswarup Tunga
Mar 22 at 17:14
Then I think your approach is a good.
– Shantiswarup Tunga
Mar 22 at 17:14
add a comment |
0
active
oldest
votes
Your Answer
StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55284553%2fbest-practice-for-naming-akka-actors-in-the-companion-object%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
0
active
oldest
votes
0
active
oldest
votes
active
oldest
votes
active
oldest
votes
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55284553%2fbest-practice-for-naming-akka-actors-in-the-companion-object%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
I think
this.getClass.getName
is a good practice.Of these actors, only up to one single instant is alive at any given moment of my application
Kindly confirm the mentioned feature you want or not ?– Shantiswarup Tunga
Mar 22 at 9:58
Of these actors, only up to one single instant is alive at any given moment of my application
This is the case in my application and I do not intend to change that. :)– Florian Baierl
Mar 22 at 13:04
Then I think your approach is a good.
– Shantiswarup Tunga
Mar 22 at 17:14