aboutsummaryrefslogtreecommitdiffstats
path: root/lib/common_test/src/ct_event.erl
diff options
context:
space:
mode:
authorLukas Larsson <[email protected]>2012-07-19 16:31:51 +0200
committerLukas Larsson <[email protected]>2012-07-19 16:31:51 +0200
commited273fd511169dba3686f97c7276a6508973400b (patch)
tree8e5f75ee13895591167787c5c97bc5f95af0b6aa /lib/common_test/src/ct_event.erl
parent82470e1c820e367007338b8e188d7d985aabe77b (diff)
parent56d2d5ece7a1abdafcab830cbb5e83663b38ec00 (diff)
downloadotp-ed273fd511169dba3686f97c7276a6508973400b.tar.gz
otp-ed273fd511169dba3686f97c7276a6508973400b.tar.bz2
otp-ed273fd511169dba3686f97c7276a6508973400b.zip
Merge branch 'maint'
* maint: 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.erl16
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.
%%--------------------------------------------------------------------