mirror of
https://github.com/gelldur/EventBus.git
synced 2024-12-28 04:50:52 +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!
|
# BUILD_SHARED_LIBS can controll build type!
|
||||||
project(EventBus
|
project(EventBus
|
||||||
VERSION 2.4.1
|
VERSION 2.5.0
|
||||||
LANGUAGES CXX
|
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.
|
* 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.
|
* @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