actors :: Proxy :: defaultinit
# Abstraction of proxies for threaded actors
class Proxy
# Type of the actor `self` is proxiing
type E: Actor
# The proxied actor
var actor: E is noinit
# Kill `actor` without mercy
fun kill do actor.kill
# Tell `actor` to terminate properly
# Queueing a ShutDownMessage to the end of its mailbox
fun terminate do
var msg = new ShutDownMessage
actor.mailbox.push(msg)
end
# Tell `actor` to terminate now
# Queueing a ShutDownMessage before every other ones
fun terminate_now do
var msg = new ShutDownMessage
actor.mailbox.unshift(msg)
end
# Wait for `actor` to terminate
fun wait_termination do actor.join
end
lib/actors/actors.nit:132,1--160,3