async.monkey2 936 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. Namespace std.async
  2. #import "native/async.cpp"
  3. #import "native/async_cb.cpp"
  4. #import "native/async.h"
  5. #import "native/async_cb.h"
  6. #If __TARGET__="android"
  7. #Import "native/Monkey2Async.java"
  8. #Endif
  9. Extern
  10. #rem monkeydoc @hidden
  11. Internal struct used to deliver events from remote threads.
  12. Probably best to just forget you even saw this...
  13. #end
  14. Struct AsyncEvent="bbAsync::Event"
  15. Method Post()="post"
  16. Method Dispatch() Virtual="dispatch"
  17. End
  18. 'Should be invoked on mx2 thread.
  19. #rem monkeydoc @hidden
  20. #end
  21. Function CreateAsyncCallback:Int( func:Void(),oneshot:bool )="bbAsync::createAsyncCallback"
  22. 'Should be invoked on mx2 thread. No effect if callback has been posted.
  23. #rem monkeydoc @hidden
  24. #end
  25. Function DestroyAsyncCallback:Int( callback:Int )="bbAsync::destroyAsyncCallback"
  26. 'Can be invoked on any thread.
  27. #rem monkeydoc @hidden
  28. #end
  29. Function InvokeAsyncCallback( callback:Int )="bbAsync::invokeAsyncCallback"
  30. Public