[DGD] call_out vs heart_beat

Felix A. Croes felix at dworkin.nl
Fri Aug 2 12:35:10 CEST 2002


Kirk Turner <kirk.turner at wagoonline.com> wrote:

> The current thread about running commands every 5 minutes has reminded 
> me of a question that I have about dgd.
>
> I first started coding on a heaven7 mudlib clone running on the lpmud 
> driver. In this system all objects can have a heart_beat, which, when 
> the object is registered as having one, gets the heart_beat function 
> called in the object every heartbeat (which was a configurable time, 
> default of 2 seconds). Call outs exist as well, but having a recursive 
> call_out was frowned upon, because it was ineffecient.
>
> Anyway my question is, why doesn't dgd have a heart_beat system? Are 
> recursive call_outs now more efficient or is there another reason? Was 
> the heart beat system just way too confusing and more hassle than it was 
> worth?

The short answer is, "because heartbeats can be simulated with callouts."

The long answer starts with a counter-question: why did LPmud have
heartbeats in the first place?

Originally, LPmud had <only> heartbeats, as a way to implement periodical
tasks (all with a period of 2 seconds).  Pretty soon however, people began
to be interested in timed/delayed, as opposed to periodical, tasks.  You
can implement the former using the latter, and indeed that is how it is
done in the player object of the 2.4.5 mudlib.  But that is both
inefficient, since there are many heartbeat calls where nothing is done,
and something of a conceptual twist.

Later on, callouts were added to LPmud.  Their implementation was quite
inefficient, and thus the idea started that there were efficiency reasons
for not using them.

DGD's implementation of callouts is far more efficient.  In particular,
simulating heartbeats by using repeated callouts with 2 second delays is
very efficient.  Additionally, newer mudlibs began to back away from
using heartbeats at all.  Therefore, they were never implemented.

Regards,
Dworkin
_________________________________________________________________
List config page:  http://list.imaginary.com/mailman/listinfo/dgd



More information about the DGD mailing list