#include <EBusSharedDispatchTraits.h>
EBusSharedDispatchTraits is a custom mutex type and lock guards that can be used with an EBus to allow for parallel dispatch calls, but still prevents connects / disconnects during a dispatch.
Features:
Limitations:
Usage: To use the traits, inherit from EBusSharedDispatchTraits<BusType>: class MyBus : public AZ::EBusSharedDispatchTraits<MyBus>
Alternatively, you can directly define the specific traits via the following: using MutexType = AZ::EBusSharedDispatchMutex;
template <typename MutexType, bool IsLocklessDispatch> using DispatchLockGuard = AZ::EBusSharedDispatchMutexDispatchLockGuard<AZ::EBus<MyBus>>;
template<typename MutexType> using ConnectLockGuard = AZ::EBusSharedDispatchMutexConnectLockGuard<AZ::EBus<MyBus>>;
template<typename MutexType> using CallstackTrackerLockGuard = AZ::EBusSharedDispatchMutexCallstackLockGuard<AZ::EBus<MyBus>>;