SYNOPSIS
mixed * P_HBHOOKS "HbHooks"
mixed * SetHbHooks(mixed * value)
mixed * QueryHbHooks()
used via
void AddHeart (mixed hook)
void RemoveHeart (mixed hook)
int CheckHeart (mixed hook)
DESCRIPTION
The heartbeat hooks are a list of functions to be called in every
heartbeat of the living. The functions have to return a non-zero
value if they want to be called again in the next heartbeat, and
a zero value if no further call is necessary.
A hook can be a string with the name of the function to call, or
a closure to execute. In the former case, the function has to be
implemented by the living itself, in the latter case it can be
an outside function.
The list of hooks is maintained through the functions AddHbHook()
and RemoveHbHook(). Multiple calls to one function for the same
hook are allowed.
EXAMPLE
AddHbHook(#'talk_more); // Call talk_more() in the next heart_beat.
RemoveHbHook(#'talk_more); // Stop calling talk_more()
BUGS
If the same function is added once as string and once as closure,
it is called twice.
AVAILABILITY
Include: <properties.h>
Availability: /std/living (/heart)
SEE ALSO
heart(p)