changeset 7:99572a386ccf

Removed with_message and with_message_or_timeout
author samer
date Mon, 13 Feb 2012 16:40:36 +0000
parents ef5802225f99
children 71aa901aa435
files qutils.pl
diffstat 1 files changed, 1 insertions(+), 35 deletions(-) [+]
line wrap: on
line diff
--- a/qutils.pl	Mon Feb 13 13:04:26 2012 +0000
+++ b/qutils.pl	Mon Feb 13 16:40:36 2012 +0000
@@ -1,7 +1,5 @@
 :- module( qutils, 
-		[	with_message/2
-		,	with_message_or_timeout/4
-		,	get_message_or_timeout/2
+		[	get_message_or_timeout/2
 		,	send_with_size_limit/3
 		]).
 
@@ -63,38 +61,6 @@
 
 :-endif.
 
-
-%% with_message( Msg, :Goal) is nondet.
-%
-%  Waits for next message, unify with Msg, and call Goal.
-%  This procedure gets the next term out of the current thread's
-%  message queue, waiting if necessary. If it is 'quit', then
-%  it succeeds immediately leaving Msg unchanged. If it unifies
-%  with Msg, then Goal is called. Otherwise, a message is printed
-%  and the proceduce succeeds.
-with_message(Temp,OnEvent) :-
-	thread_get_message(Msg),
-	(	Msg=quit -> true
-	;	Msg=Temp -> call(OnEvent)
-	;	writeln(template_mismatch(Temp,Msg))
-	).
-
-%% with_message_or_timeout( +TimeOut, Msg, :OnEvent, :OnTimeOut) is nondet.
-%
-%  Time limited wait for message with handler goals for either case.
-%  Waits up to TimeOut seconds for next message, unify with Msg, 
-%  and call OnEvent. If none arrives before TimeOut expires,
-%  OnTimeOut is called instead. If the message is 'quit', it
-%  just returns. If the message does not unify with Msg, some
-%  text is printed and the proceduce succeeds.
-with_message_or_timeout(T,Temp,OnEvent,OnTimeout) :- 
-	get_message_or_timeout(T,Msg),
-	(	Msg=quit    -> true
-	;	Msg=timeout -> call(OnTimeout)
-	;	Msg=Temp    -> call(OnEvent)
-	;	writeln(template_mismatch(Temp,Msg))
-	).
-
 %% send_with_size_limit( +Max:natural, +Queue:queue_id, +Msg:term) is det.
 %
 %  Adds term to message queue unless queue is already full.