Swift implementation of the actor model