#Gleam ref - just in case

1 messages · Page 1 of 1 (latest)

agile ledge
knotty hill
#

Nice! You probably also want a way to shut the actor down as otherwise it'll live forever and you'll leak memory

#

get also says it can never fail- but in reality it can as the actor might be dead

#

Not sure if that matters though

#

Probably also want a way to get the Pid too so you can supervise it

#

Check out Elixir's Actor if you haven't

agile ledge
knotty hill
#

Actors can do things all by themselves and there's no global garbage collection in Erlang so there's no real way the runtime could tell if you're finished with one

#

And there's ways to get a reference to one after other references have been lost

knotty hill
agile ledge
knotty hill
#

You could keep it not return a result if you like

#

But documenting that it panics if the actor is shutdown could be good

agile ledge
knotty hill
#

What do you mean, sorry?

agile ledge
#

other than a panic in the function that the actor calls with the Set message

knotty hill
#

You could find the process id through VM debugging and monitoring tools and then manually kill it

knotty hill
agile ledge
knotty hill
#

Yes

#

You can always kill an actor

#

Or it could have a bug and crash

#

Or you could hit memory exhaustion issues