userver: concurrent Namespace Reference
Loading...
Searching...
No Matches
concurrent Namespace Reference

Detailed Description

Locking stuff.

Classes

class  AsyncEventChannel
class  AsyncEventSource
 The read-only side of an event channel. Events are delivered to listeners in a strict FIFO order, i.e. only after the event was processed a new event may appear for processing, same listener is never called concurrently. More...
class  BackgroundTaskStorage
class  BackgroundTaskStorageCore
class  ConflatedEventChannel
 A non-blocking version of 'AsyncEventChannel'. More...
class  Consumer
 Consumer side of concurrent queues. More...
struct  DefaultQueuePolicy
 The default queue policy for GenericQueue. Custom queue policies must inherit from it. More...
class  FunctionId
class  GenericQueue
 Queue with single and multi producer/consumer options. More...
class  ItemMutex
class  LazyValue
 Lazy value computation with multiple consumers. More...
class  LockedPtr
 Proxy class for locked access to data protected with locking::SharedLock<T>. More...
class  MpscQueue
class  MutexSet
 A dynamic set of mutexes. More...
struct  ParallelCollectSettings
 Settings for concurrent::CollectInParallel. More...
class  Producer
 Producer side of concurrent queues. More...
class  StripedCounter
 A contention-free sharded atomic counter, with memory consumption and read performance traded for write performance. Intended to be used for write-heavy counters, mostly in metrics. More...
class  Variable

Typedefs

using BackgroundTaskStorageFastPimpl = utils::FastPimpl<BackgroundTaskStorage, 208, 16>
template<typename T>
using NonFifoMpmcQueue = GenericQueue<T, impl::SimpleQueuePolicy<true, true>>
 Non FIFO multiple producers multiple consumers queue.
template<typename T>
using NonFifoMpscQueue = GenericQueue<T, impl::SimpleQueuePolicy<true, false>>
 Non FIFO multiple producers single consumer queue.
template<typename T>
using SpmcQueue = GenericQueue<T, impl::SimpleQueuePolicy<false, true>>
 Single producer multiple consumers queue.
template<typename T>
using SpscQueue = GenericQueue<T, impl::SimpleQueuePolicy<false, false>>
 Single producer single consumer queue.
template<typename T>
using UnboundedNonFifoMpscQueue = GenericQueue<T, impl::NoMaxSizeQueuePolicy<true, false>>
 Like concurrent::NonFifoMpscQueue, but does not support setting max size and is thus slightly faster.
template<typename T>
using UnboundedSpmcQueue = GenericQueue<T, impl::NoMaxSizeQueuePolicy<false, true>>
 Like concurrent::SpmcQueue, but does not support setting max size and is thus slightly faster.
template<typename T>
using UnboundedSpscQueue = GenericQueue<T, impl::NoMaxSizeQueuePolicy<false, false>>
 Like concurrent::SpscQueue, but does not support setting max size and is thus slightly faster.
using StringStreamQueue = GenericQueue<std::string, impl::ContainerQueuePolicy<false, false>>
 Single producer single consumer queue of std::string which is bounded by the total bytes inside the strings.
using StringStreamQueueConsumer
 Consumer of concurrent::StringStreamQueue.

Enumerations

enum class  CollectFailurePolicy : std::uint8_t {
  kContinue ,
  kFailFast
}
enum class  QueueMaxSizeMode {
  kNone ,
  kDynamicSync
}
 Represents the manner in which the queue enforces the configured max size limit. More...

Functions

template<std::ranges::input_range Range, typename Start>
requires std::invocable<const Start&, std::ranges::range_reference_t<Range>> && impl::CollectableFuture<std::invoke_result_t
<const Start&, std::ranges::range_reference_t<Range>>>
auto CollectInParallel (Range &&input_range, ParallelCollectSettings settings, const Start &start) -> std::vector< utils::expected< impl::CollectedValue< std::invoke_result_t< const Start &, std::ranges::range_reference_t< Range > > >, std::exception_ptr > >
 Collect results from lazily started operations with bounded concurrency.

Typedef Documentation

◆ BackgroundTaskStorageFastPimpl

using concurrent::BackgroundTaskStorageFastPimpl = utils::FastPimpl<BackgroundTaskStorage, 208, 16>

Definition at line 15 of file background_task_storage_fwd.hpp.

◆ StringStreamQueueConsumer

Enumeration Type Documentation

◆ CollectFailurePolicy

enum class concurrent::CollectFailurePolicy : std::uint8_t
strong
Enumerator
kContinue 

Collect individual errors and process all inputs.

kFailFast 

Stop starting inputs, clean up in-flight work, and rethrow the first observed error.

Definition at line 31 of file collect_in_parallel.hpp.

◆ QueueMaxSizeMode

enum class concurrent::QueueMaxSizeMode
strong

Represents the manner in which the queue enforces the configured max size limit.

See also
GenericQueue
DefaultQueuePolicy
Enumerator
kNone 

No support for setting max size. Fastest.

kDynamicSync 

Supports dynamically changing max size; supports awaiting non-fullness in producers. Slightly slower than concurrent::QueueMaxSizeMode::kNone.

Definition at line 30 of file queue.hpp.