createSubscriptionToPush#
Fully qualified name: carb::events::createSubscriptionToPush
Defined in carb/events/EventsUtils.h
-
template<typename ConstCharPtr, typename = std::enable_if_t<cpp::is_unsafe_string_view_like_v<ConstCharPtr>>>
inline ObjectPtr<ISubscription> carb::events::createSubscriptionToPush( - IEventStream1_0 *stream,
- std::function<void(IEvent*)> onEventFn,
- Order order,
- const ConstCharPtr &subscriptionName,
A helper for IEventStream::createSubscriptionToPush() that creates a LambdaEventListener.
- Parameters:
stream – The IEventStream to use.
onEventFn – A handler that will be invoked for each carb::events::IEvent that is pushed.
order – An optional value used to specify the order tier. Lower order tiers will be notified first. Multiple IEventListener objects at the same order tier are notified in an undefined order.
subscriptionName – An optional name for the subscription. Names do not need to be unique.
- Returns:
A ISubscription pointer. The subscription is valid as long as the ISubscription pointer is referenced. Alternately, the IEventListener can be unsubscribed by calling ISubscription::unsubscribe().