mirror of
https://github.com/gelldur/EventBus.git
synced 2024-12-27 12:21:02 +08:00
Add AsyncEventBus::notify
This commit is contained in:
parent
2edc809a74
commit
aa96ba493d
@ -2,7 +2,7 @@ cmake_minimum_required(VERSION 3.8 FATAL_ERROR)
|
||||
|
||||
# BUILD_SHARED_LIBS can controll build type!
|
||||
project(EventBus
|
||||
VERSION 2.4.1
|
||||
VERSION 2.5.0
|
||||
LANGUAGES CXX
|
||||
)
|
||||
|
||||
|
@ -163,6 +163,18 @@ public:
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Schedule and consume event. Notify all listeners with event.
|
||||
*
|
||||
* @param event your event struct
|
||||
*/
|
||||
template <typename Event>
|
||||
void notify(const Event& event)
|
||||
{
|
||||
schedule(event);
|
||||
consume(1);
|
||||
}
|
||||
|
||||
/**
|
||||
* Process queued events. This should be called always on same thread.
|
||||
* @param max maximum count of events to consume, if 0 then all available events will be consumed.
|
||||
|
Loading…
x
Reference in New Issue
Block a user