public static void addHandler(Func func) { if (!func.isImmutable()) throw NotImmutableErr.make("handler must be immutable").val; lock (lockObj) { List temp = new List(Sys.FuncType, m_handlers).add(func); m_handlers = (Func[])temp.toArray(new Func[temp.sz()]); } }
public static void addHandler(Func func) { if (!func.isImmutable()) { throw NotImmutableErr.make("handler must be immutable").val; } lock (lockObj) { List temp = new List(Sys.FuncType, m_handlers).add(func); m_handlers = (Func[])temp.toArray(new Func[temp.sz()]); } }
public static void makeCoalescing_(Actor self, ActorPool pool, Func k, Func c, Func r) { if (k != null && !k.isImmutable()) { throw NotImmutableErr.make("Coalescing toKey func not immutable: " + k).val; } if (c != null && !c.isImmutable()) { throw NotImmutableErr.make("Coalescing coalesce func not immutable: " + c).val; } make_(self, pool, r); self.m_queue = new CoalescingQueue(k, c); }
public static void make_(Actor self, ActorPool pool, Func receive) { // check pool if (pool == null) { throw NullErr.make("pool is null").val; } // check receive method if (receive == null && self.@typeof().qname() == "concurrent::Actor") { throw ArgErr.make("must supply receive func or subclass Actor").val; } if (receive != null && !receive.isImmutable()) { throw NotImmutableErr.make("Receive func not immutable: " + receive).val; } // init self.m_pool = pool; self.m_receive = receive; self.m_queue = new Queue(); }
public static void makeCoalescing_(Actor self, ActorPool pool, Func k, Func c, Func r) { if (k != null && !k.isImmutable()) throw NotImmutableErr.make("Coalescing toKey func not immutable: " + k).val; if (c != null && !c.isImmutable()) throw NotImmutableErr.make("Coalescing coalesce func not immutable: " + c).val; make_(self, pool, r); self.m_queue = new CoalescingQueue(k, c); }
public static void make_(Actor self, ActorPool pool, Func receive) { // check pool if (pool == null) throw NullErr.make("pool is null").val; // check receive method if (receive == null && self.@typeof().qname() == "concurrent::Actor") throw ArgErr.make("must supply receive func or subclass Actor").val; if (receive != null && !receive.isImmutable()) throw NotImmutableErr.make("Receive func not immutable: " + receive).val; // init self.m_pool = pool; self.m_receive = receive; self.m_queue = new Queue(); }