Not logged in.  Login/Logout/Register | List snippets | | Create snippet | Upload image | Upload data

26
LINES

< > BotCompany Repo | #1019736 // vmBus_onMessage (old version)

JavaX fragment (include)

static <A> AutoCloseable vmBus_onMessage(fS msg, final VF1<A> onMessage) {
  ret tempAdd(vm_busListeners_live(), voidfunc(S _msg, O arg) {
    if (eq(msg, _msg))
      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

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

static AutoCloseable vmBus_onMessage(S msg, Runnable onMessage) {
  ret vmBus_onMessage(msg, runnableToVF1(onMessage));
}

Author comment

Began life as a copy of #1018419

download  show line numbers  debug dex  old transpilations   

Travelled to 11 computer(s): bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, irmadwmeruwu, ishqpsrjomds, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt

No comments. add comment

-
Snippet ID: #1019736
Snippet name: vmBus_onMessage (old version)
Eternal ID of this version: #1019736/1
Text MD5: ea310df6c0ae2304ae0358503712917e
Author: stefan
Category: javax / vm
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2018-11-24 03:30:38
Source code size: 752 bytes / 26 lines
Pitched / IR pitched: No / No
Views / Downloads: 290 / 310
Referenced in: