diff options
author | Konstantin Varlamov <var-const@users.noreply.github.com> | 2018-05-07 12:22:57 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-05-07 12:22:57 -0400 |
commit | 38824e721ebaa3f50e443e1ea4b47d34030e4703 (patch) | |
tree | b4a7f806b52f40d85fb92e571c216acaeba2fdc3 /Firestore/core/src/firebase/firestore/util/CMakeLists.txt | |
parent | 04a28fce81c737b6505e6c542a14d8529c9f891d (diff) |
C++ migration: add AsyncQueue, the C++ version of FSTDispatchQueue (#1176)
AsyncQueue is a queue that executes given operations asynchronously,
enforcing that only a single operation is executing at any given time,
and that in-progress operations don't spawn more operations. The actual
execution is delegated to a platform-specific executor. Executor is an
interface for a FIFO queue that executes given operations serially. Two
implementations of Executor, one using libdispatch and the other using
C++11 standard library, are provided.
AsyncQueue is not used anywhere in the code base at this point.
Diffstat (limited to 'Firestore/core/src/firebase/firestore/util/CMakeLists.txt')
-rw-r--r-- | Firestore/core/src/firebase/firestore/util/CMakeLists.txt | 58 |
1 files changed, 58 insertions, 0 deletions
diff --git a/Firestore/core/src/firebase/firestore/util/CMakeLists.txt b/Firestore/core/src/firebase/firestore/util/CMakeLists.txt index 95cd72f..29d91c7 100644 --- a/Firestore/core/src/firebase/firestore/util/CMakeLists.txt +++ b/Firestore/core/src/firebase/firestore/util/CMakeLists.txt @@ -109,6 +109,63 @@ else() endif() +## async queue + +check_symbol_exists(dispatch_async_f dispatch/dispatch.h HAVE_LIBDISPATCH) + +cc_library( + firebase_firestore_util_executor_std + SOURCES + executor_std.cc + executor_std.h + executor.h + DEPENDS + absl_bad_optional_access + absl_optional + ${FIREBASE_FIRESTORE_UTIL_LOG} + EXCLUDE_FROM_ALL +) + +if(HAVE_LIBDISPATCH) +cc_library( + firebase_firestore_util_executor_libdispatch + SOURCES + executor_libdispatch.cc + executor_libdispatch.h + executor.h + DEPENDS + absl_bad_optional_access + absl_optional + absl_strings + ${FIREBASE_FIRESTORE_UTIL_LOG} + EXCLUDE_FROM_ALL +) +endif() + +if(HAVE_LIBDISPATCH) + set( + FIREBASE_FIRESTORE_UTIL_EXECUTOR + firebase_firestore_util_executor_libdispatch + ) + +else() + set( + FIREBASE_FIRESTORE_UTIL_EXECUTOR + firebase_firestore_util_executor_std + ) + +endif() + +cc_library( + firebase_firestore_util_async_queue + SOURCES + async_queue.cc + async_queue.h + DEPENDS + ${FIREBASE_FIRESTORE_UTIL_EXECUTOR} + ${FIREBASE_FIRESTORE_UTIL_LOG} + EXCLUDE_FROM_ALL +) ## main library @@ -144,6 +201,7 @@ cc_library( DEPENDS absl_base firebase_firestore_util_base + firebase_firestore_util_async_queue ${FIREBASE_FIRESTORE_UTIL_LOG} ${FIREBASE_FIRESTORE_UTIL_RANDOM} ) |