Oh, I thought I'd have to do that, I just wondered...
# coroutines
d
Oh, I thought I'd have to do that, I just wondered if I was missing something or it would be included eventually... Also, how does one make a class out of
actor { }
and still be thread safe, can the class member vars be used or do they have to be contained in the
actor { }
function? And there must be an actor val to keep and return the actor.. one can't call send straight from the class. It would be nice to be able to derive from an actor abstract class...
e
If you do an actor class, then keep all its state
private
to it.
d
Then I'd have to declare
val actor = actor { }
on it and do
ActorClass().actor.send()
, if there would be an abstract class to derive from, it would just be
ActorClass().send()
is there an easy way to do this?
e
Go ahead and define yourself an abstract actor class with suspend send method.
d
I guess I could inherit it from Send channel and delegate the methods to an internal actor to avoid the problem you pointed out to Mr. Lucas a few days ago on his actor compiler... I suppose this won't be added to the core library some time?