1 /** 2 Copyright: Copyright (c) 2021, Joakim Brännström. All rights reserved. 3 License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost Software License 1.0) 4 Author: Joakim Brännström (joakim.brannstrom@gmx.com) 5 */ 6 module my.actor.system_msg; 7 8 import my.actor.common : SystemError, ExitReason; 9 import my.actor.mailbox : WeakAddress; 10 import my.typecons : CopyCtor; 11 12 /// Sent to all links when an actor is terminated. 13 struct ExitMsg { 14 /// The source of this message, i.e., the terminated actor. 15 WeakAddress source; 16 17 /// The exit reason of the terminated actor. 18 SystemError reason; 19 } 20 21 /// The system signals the actor to shutdown. 22 struct SystemExitMsg { 23 /// The systems exit reason of the terminated actor. 24 ExitReason reason; 25 } 26 27 /// Sent to all actors monitoring an actor that is terminated. 28 struct DownMsg { 29 /// The source of this message, i.e., the terminated actor. 30 WeakAddress source; 31 32 /// The exit reason of the terminated actor. 33 SystemError reason; 34 } 35 36 struct ErrorMsg { 37 /// The source of this message, i.e., the terminated actor. 38 WeakAddress source; 39 40 /// The exit reason of the terminated actor. 41 SystemError reason; 42 } 43 44 // Incoming requests to link to the actor using this address. 45 struct MonitorRequest { 46 WeakAddress addr; 47 } 48 49 // Request to remove `addr` as a monitor. 50 struct DemonitorRequest { 51 WeakAddress addr; 52 } 53 54 // Incoming requests to link to the actor using this address. 55 struct LinkRequest { 56 WeakAddress addr; 57 } 58 59 // Request to remove `addr` as a link. 60 struct UnlinkRequest { 61 WeakAddress addr; 62 }