[cpp worker] support Ray::Get() static method (#9809)

This commit is contained in:
SongGuyang
2020-08-06 16:20:05 +08:00
committed by GitHub
parent 7d4f204aa8
commit 17ddcd8691
2 changed files with 21 additions and 4 deletions
+8 -4
View File
@@ -39,6 +39,14 @@ class Ray {
template <typename T>
static ObjectRef<T> Put(const T &obj);
/// Get a single object from the object store.
/// This method will be blocked until the object is ready.
///
/// \param[in] object The object reference which should be returned.
/// \return shared pointer of the result.
template <typename T>
static std::shared_ptr<T> Get(const ObjectRef<T> &object);
/// Get a list of objects from the object store.
/// This method will be blocked until all the objects are ready.
///
@@ -77,10 +85,6 @@ class Ray {
static std::once_flag is_inited_;
/// Used by ObjectRef to implement .Get()
template <typename T>
static std::shared_ptr<T> Get(const ObjectRef<T> &object);
template <typename ReturnType, typename FuncType, typename ExecFuncType,
typename... ArgTypes>
static TaskCaller<ReturnType> TaskInternal(FuncType &func, ExecFuncType &exec_func,