VoiceGarbageProcs.mesa
Copyright © 1986 by Xerox Corporation. All rights reserved.
Doug Terry, June 30, 1986 3:04:42 pm PDT
Class-specific procedures for determining whether a registered interest in a voice rope is still valid.
DIRECTORY
BasicTime USING [Now, Period],
Convert USING [Error, IntFromRope],
FS USING [Error, FileInfo],
VoiceCleanup USING [IsGarbageProc, RegisterClass];
VoiceGarbageProcs: CEDAR PROGRAM
IMPORTS BasicTime, Convert, FS, VoiceCleanup
~ BEGIN
TiogaVoice
For interests of type "TiogaVoice", the refID is the name of a Tioga file containing voice annotations. An interest can be collected when the file no longer exists.
FileNonExistent: VoiceCleanup.IsGarbageProc ~ {
PROC[interest: VoiceCleanup.InterestInfo] RETURNS [BOOLEANFALSE]
gone: BOOLEANFALSE;
[] ← FS.FileInfo[interest.refID ! FS.Error => {
IF error.group = user AND error.code = $unknownFile THEN gone ← TRUE;
CONTINUE}];
RETURN[gone];
};
Timeout
For interests of type "Timeout", the refID is irrelevant (it may be the name of a Tioga file containing voice annotations); the data field contains a timeout value in seconds. An interest can be collected when the time since creation is greater than this timeout.
TimeoutExpired: VoiceCleanup.IsGarbageProc ~ {
PROC[interest: VoiceCleanup.InterestInfo] RETURNS [BOOLEANFALSE]
timeout: INT;
timeout ← Convert.IntFromRope[interest.data ! Convert.Error => {timeout ← 0; CONTINUE}];
RETURN[BasicTime.Period[from: interest.timestamp, to: BasicTime.Now[]] > timeout];
};
SysNoises
For interests of type "SysNoises", the refID is a name for a recorded sound, such as "BeepTune" or "Rollback". Interests of this class are never implicitly collected.
Permanent: VoiceCleanup.IsGarbageProc ~ {
PROC[interest: VoiceCleanup.InterestInfo] RETURNS [BOOLEANFALSE]
RETURN[FALSE];
};
WalnutMsg
For interests of type "WalnutMsg", the refID is the ID of a Grapevine message. Currently, such interests are explictly collected when Walnut expunges deleted messages; no implicit collection is done.
MsgDeleted: VoiceCleanup.IsGarbageProc ~ {
PROC[interest: VoiceCleanup.InterestInfo] RETURNS [BOOLEANFALSE]
RETURN[FALSE];
};
Registration
VoiceCleanup.RegisterClass[class: "WalnutMsg", proc: MsgDeleted];
VoiceCleanup.RegisterClass[class: "SysNoises", proc: Permanent];
VoiceCleanup.RegisterClass[class: "Timeout", proc: TimeoutExpired];
VoiceCleanup.RegisterClass[class: "TiogaVoice", proc: FileNonExistent];
END.
Doug Terry, June 16, 1986 3:34:18 pm PDT
Created.
changes to: DIRECTORY, VoiceGarbageProcs, IMPORTS, ~, FileNonExistent, TimeoutExpired, Permanent, MsgDeleted, VoiceCleanup, VoiceCleanup, VoiceCleanup, VoiceCleanup, END
Doug Terry, June 30, 1986 1:28:29 pm PDT
changes to: FileNonExistent
Doug Terry, June 30, 1986 3:03:08 pm PDT
changes to: TimeoutExpired, timeout (local of TimeoutExpired)
Doug Terry, June 30, 1986 3:04:42 pm PDT
changes to: DIRECTORY, TimeoutExpired