예제 #1
0
void f_asio_set_on_failed_callback(CVarRef on_failed_cb) {
  if (!on_failed_cb.isNull() && !on_failed_cb.instanceof(c_Closure::s_cls)) {
    Object e(SystemLib::AllocInvalidArgumentExceptionObject(
      "Unable to set asio on failed callback: on_failed_cb not a closure"));
    throw e;
  }
  AsioSession::Get()->setOnFailedCallback(on_failed_cb.getObjectDataOrNull());
}
void c_SetResultToRefWaitHandle::ti_setoncreatecallback(CVarRef callback) {
  if (!callback.isNull() && !callback.instanceof(c_Closure::classof())) {
    Object e(SystemLib::AllocInvalidArgumentExceptionObject(
      "Unable to set SetResultToRefWaitHandle::onCreate: on_create_cb not a closure"));
    throw e;
  }
  AsioSession::Get()->setOnSetResultToRefCreateCallback(callback.getObjectDataOrNull());
}
예제 #3
0
void c_WaitHandle::ti_setonjoincallback(CVarRef callback) {
  if (!callback.isNull() && !callback.instanceof(c_Closure::classof())) {
    Object e(SystemLib::AllocInvalidArgumentExceptionObject(
      "Unable to set WaitHandle::onJoin: on_join_cb not a closure"));
    throw e;
  }
  AsioSession::Get()->setOnJoinCallback(callback.getObjectDataOrNull());
}
void c_ContinuationWaitHandle::ti_setonfailcallback(CVarRef callback) {
  if (!callback.isNull() && !callback.instanceof(c_Closure::s_cls)) {
    Object e(SystemLib::AllocInvalidArgumentExceptionObject(
      "Unable to set ContinuationWaitHandle::onFail: on_fail_cb not a closure"));
    throw e;
  }
  AsioSession::Get()->setOnContinuationFailCallback(callback.getObjectDataOrNull());
}
예제 #5
0
void c_AsyncFunctionWaitHandle::ti_setonsuccesscallback(CVarRef callback) {
  if (!callback.isNull() && !callback.instanceof(c_Closure::classof())) {
    Object e(SystemLib::AllocInvalidArgumentExceptionObject(
      "Unable to set AsyncFunctionWaitHandle::onSuccess: on_success_cb not a closure"));
    throw e;
  }
  AsioSession::Get()->setOnAsyncFunctionSuccessCallback(callback.getObjectDataOrNull());
}