Subject: Improving the server (and VROOMs too!)

From: Andrew Wilson <[email-masked]>
Date: Fri, 7 Aug 1992 15:18:01 -0700

Hi,
	top of my "If only MOO could do this!" list HAS to be
a resume() command.

You normally suspend a task in MOO by using a suspend(Seconds) call
which suspends the task for so many seconds and then gets going again.
What I'd like to be able to do is something like:

	"myverb"
	MyTask = task_id();
	fork (0)
		"do something involved and time consuming"
		Results = <something or other>;
		resume(MyTask);
	endfork;
	ReturnValue = suspend(10);
	if (ReturnValue = E_TIMEOUT)
		player:tell("We're having problems, sorry.");
	else
		player:tell("Ok, the results are: ", Results);
	endif;

This means that suspend() would return E_TIMEOUT if its allotted 10 seconds
were up and E_RESUMED (say) if the task had been resumed by the action
of some other agent in the MOO.

Note that E_TIMEOUT does not mean that the command failed, just that the
calling verb ran out of time.  It's up to the caller of suspend() to
interpret the return value wisely.

The principal advantage of resume() is that you don't have to keep polling
the value of 'Results' every second or so like you do at the moment:

	"myotherverb"
	Results = $nothing;
	fork (0)
		"do something involved and time consuming"
		Results = <something or other>;
	endfork;

	TimeOut = 0;
	while (Results == $nothing && TimeOut < 10)
		sleep(1);
		TimeOut = TimeOut + 1;
	endwhile;
	if (Results == $nothing)
		player:tell("We're having problems, sorry.");
	else
		player:tell("Ok, the results are: ", Results);
	endif;

An additional advantage is that the semantics of suspend() are unchanged
as far as existing code is concerned.  A call like suspend(10) will STLL
resume its calling task after 10 seconds.

This feature is really too sexy to pass up.  Please, please, please
put it in the next version of the MOO server.

Luv, Andrew Wilson.

ps.  The VROOM concept works.  I have it running on 3 machines with a
Vtopology of 4 VROOMs.  Occupants of a VROOM can use the 'say', 'emote'
and 'look' commands as you'd expect for a normal $room.  I'll have more to
say about an evaluation package I'm building for publication next week,
if anyone's interested that is.  He, he, he.

I feel GOOD!