-
Notifications
You must be signed in to change notification settings - Fork 23
Misleading approach to actor initialization #50
Comments
Thanks for your feedback! Which places of potential documentation have you visited before trying this out? It would be good to know where we can place a hint that alerts users to this potential oversight(*). (*) it is a user oversight since technically there cannot really be space for initialization within a block that receives a |
Hi Roland, |
|
Right, I know that it looks tempting; what I meant was that we couldn’t possibly implement things such that initialization becomes supported in that fashion. If you have not looked at anything else besides the blog post (no API docs, no reference docs, no IDE tooltips) then the only place where we can improve the situation is that blog post (we should probably also add a note to all these other places, but I fear most users will not read them). |
I also read the official docs but there was no clarification that ctx.self in |
Ah, good: can you suggest an exact placement of such clarification? Easiest might be a PR (can be done on github with the edit feature). |
ok, I will |
PreStart signal has been removed from it and it was suggested to use Actor.deferred instead
But it can be misleading for the newcomers.
Here is the example, lets say I want to schedule a message to ctx.self from an actor
This is the correct approach
But my initial incorrect approach was
I guess my problem with it that it is really easy to make a mistake, because It looks like I have some space for initialization logic after
(ctx, msg) =>
partAlso might be not clear that ctx.self inside of
deferred
is the same as in underlyingimmutable
blockP.S. I know that there was already a lot of talks related to that. But I just sharing my feedback and the problem that many can potentially face with this version of API
The text was updated successfully, but these errors were encountered: