rts support for synchronous and asynchronous callbacks from js