diff options
author | Lukas Larsson <[email protected]> | 2012-07-19 16:30:14 +0200 |
---|---|---|
committer | Lukas Larsson <[email protected]> | 2012-07-19 16:30:14 +0200 |
commit | 56d2d5ece7a1abdafcab830cbb5e83663b38ec00 (patch) | |
tree | 99dc2b3532d1e748c6592445148d66cf19e4e71c /lib/common_test/src/ct_event.erl | |
parent | 95bf75bc27c07bc6a5054fb762cd07335d64b642 (diff) | |
parent | 1afa5d69e5d42e8837f7fb975671487c6301b42f (diff) | |
download | otp-56d2d5ece7a1abdafcab830cbb5e83663b38ec00.tar.gz otp-56d2d5ece7a1abdafcab830cbb5e83663b38ec00.tar.bz2 otp-56d2d5ece7a1abdafcab830cbb5e83663b38ec00.zip |
Merge branch 'lukas/common_test/ct_notify/OTP-10157' into maint
* lukas/common_test/ct_notify/OTP-10157:
Add ct:notify and ct:sync_notify
Diffstat (limited to 'lib/common_test/src/ct_event.erl')
-rw-r--r-- | lib/common_test/src/ct_event.erl | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/lib/common_test/src/ct_event.erl b/lib/common_test/src/ct_event.erl index 3e79898ad1..998be35fda 100644 --- a/lib/common_test/src/ct_event.erl +++ b/lib/common_test/src/ct_event.erl @@ -31,7 +31,7 @@ %% API -export([start_link/0, add_handler/0, add_handler/1, stop/0]). --export([notify/1, sync_notify/1]). +-export([notify/1, notify/2, sync_notify/1,sync_notify/2]). -export([is_alive/0]). %% gen_event callbacks @@ -90,6 +90,13 @@ notify(Event) -> end. %%-------------------------------------------------------------------- +%% Function: notify(Name,Data) -> ok +%% Description: Asynchronous notification to event manager. +%%-------------------------------------------------------------------- +notify(Name, Data) -> + notify(#event{ name = Name, data = Data}). + +%%-------------------------------------------------------------------- %% Function: sync_notify(Event) -> ok %% Description: Synchronous notification to event manager. %%-------------------------------------------------------------------- @@ -102,6 +109,13 @@ sync_notify(Event) -> end. %%-------------------------------------------------------------------- +%% Function: sync_notify(Name,Data) -> ok +%% Description: Synchronous notification to event manager. +%%-------------------------------------------------------------------- +sync_notify(Name,Data) -> + sync_notify(#event{ name = Name, data = Data}). + +%%-------------------------------------------------------------------- %% Function: is_alive() -> true | false %% Description: Check if Event Manager is alive. %%-------------------------------------------------------------------- |