summaryrefslogtreecommitdiff
path: root/cpp/src/Ice
diff options
context:
space:
mode:
authorMark Spruiell <mes@zeroc.com>2016-12-09 15:18:08 -0800
committerMark Spruiell <mes@zeroc.com>2016-12-09 15:18:08 -0800
commit3b7e9f99b61538e0bbd6f07deeb7f7cb12013ed5 (patch)
treea8edbf5d1043527cc50880b34ee83458ed7e4855 /cpp/src/Ice
parentMerge remote-tracking branch 'origin/3.6' (diff)
downloadice-3b7e9f99b61538e0bbd6f07deeb7f7cb12013ed5.tar.bz2
ice-3b7e9f99b61538e0bbd6f07deeb7f7cb12013ed5.tar.xz
ice-3b7e9f99b61538e0bbd6f07deeb7f7cb12013ed5.zip
ICE-7138 - new Python AMI mapping based on futures and modified AMD mapping
Diffstat (limited to 'cpp/src/Ice')
-rw-r--r--cpp/src/Ice/OutgoingAsync.cpp37
1 files changed, 33 insertions, 4 deletions
diff --git a/cpp/src/Ice/OutgoingAsync.cpp b/cpp/src/Ice/OutgoingAsync.cpp
index 060f9019e72..40c753fe656 100644
--- a/cpp/src/Ice/OutgoingAsync.cpp
+++ b/cpp/src/Ice/OutgoingAsync.cpp
@@ -124,8 +124,7 @@ OutgoingAsyncBase::invokeExceptionAsync()
};
//
- // CommunicatorDestroyedCompleted is the only exception that can propagate directly
- // from this method.
+ // CommunicatorDestroyedException is the only exception that can propagate directly from this method.
//
_instance->clientThreadPool()->dispatch(new AsynchronousException(_cachedConnection, ICE_SHARED_FROM_THIS));
}
@@ -154,8 +153,7 @@ OutgoingAsyncBase::invokeResponseAsync()
};
//
- // CommunicatorDestroyedCompleted is the only exception that can propagate directly
- // from this method.
+ // CommunicatorDestroyedException is the only exception that can propagate directly from this method.
//
_instance->clientThreadPool()->dispatch(new AsynchronousResponse(_cachedConnection, ICE_SHARED_FROM_THIS));
}
@@ -534,6 +532,37 @@ OutgoingAsyncBase::throwUserException()
}
}
+void
+OutgoingAsyncBase::scheduleCallback(const CallbackPtr& cb)
+{
+ class WorkItem : public DispatchWorkItem
+ {
+ public:
+
+ WorkItem(const CallbackPtr& cb) : _cb(cb) {}
+
+ virtual void run()
+ {
+ try
+ {
+ _cb->run();
+ }
+ catch(...)
+ {
+ }
+ }
+
+ private:
+
+ CallbackPtr _cb;
+ };
+
+ //
+ // CommunicatorDestroyedException is the only exception that can propagate directly from this method.
+ //
+ _instance->clientThreadPool()->dispatch(new WorkItem(cb));
+}
+
#endif
void