Libraryless. Click here for Pure Java version (2924L/17K).
static <A> AutoCloseable mapMethodLike vmBus_onMessage(S msg, IVF1<A> onMessage) { ret vmBus_onMessage(msg, ivf1ToVF1(onMessage)); } static <A> AutoCloseable mapMethodLike vmBus_onMessage(fS msg, final VF1<A> onMessage) { Map<S, Set> map = vm_busListenersByMessage_live(); synchronized(map) { Set listeners = map.get(msg); if (listeners == null) map.put(msg, listeners = syncIdentityHashSet()); // We're technically violating the one-synchronized-object-per-thread rule, // but it should be OK here. // TODO: remove empty sets from map ret tempAdd(listeners, voidfunc(S _msg, O arg) { callF(onMessage, arg) }); } } ifclass VF2 static <A, B> AutoCloseable vmBus_onMessage(S msg, final VF2<A, B> onMessage) { ret vmBus_onMessage(msg, voidfunc(O[] o) { callF(onMessage, first(o), second(o)); }); } endif static <A, B> AutoCloseable vmBus_onMessage(S msg, final IVF2<A, B> onMessage) { ret vmBus_onMessage(msg, voidfunc(O[] o) { callF(onMessage, first(o), second(o)); }); } ifclass VF3 static <A, B, C> AutoCloseable vmBus_onMessage(S msg, final VF3<A, B, C> onMessage) { ret vmBus_onMessage(msg, voidfunc(O[] o) { callF(onMessage, first(o), second(o), third(o)); }); } endif ifclass VF4 static <A, B, C, D> AutoCloseable vmBus_onMessage(S msg, VF4<A, B, C, D> onMessage) { ret vmBus_onMessage(msg, voidfunc(O[] o) { callF(onMessage, first(o), second(o), third(o), last(o)); }); } endif static AutoCloseable vmBus_onMessage(S msg, Runnable onMessage) { ret vmBus_onMessage(msg, runnableToVF1(onMessage)); }
Began life as a copy of #1017923
download show line numbers debug dex old transpilations
Travelled to 14 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, irmadwmeruwu, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt, xrpafgyirdlv
No comments. add comment