DIRECTORY DFOperations USING [BringOverAction, BringOverFilter, InteractionProc, SModelAction], IO USING [STREAM], Process USING [Priority, priorityBackground], Rope USING [ROPE]; DFOperationsQueue: CEDAR DEFINITIONS = BEGIN OPEN Ops: DFOperations; ROPE: TYPE = Rope.ROPE; Queue: TYPE = REF QueueObject; QueueObject: TYPE; RequestedOp: TYPE = {bringOver, sModel, verify}; Request: TYPE = REF RequestRecord; RequestRecord: TYPE = RECORD [ dfFile: ROPE, wDir: ROPE, -- established for the duration of the operation only interact: Ops.InteractionProc, log: IO.STREAM, clientData: REF ANY, opSpecific: SELECT op: RequestedOp FROM bringOver => [filter: Ops.BringOverFilter, action: Ops.BringOverAction], sModel => [action: Ops.SModelAction], verify => NULL, ENDCASE ]; NotifierProc: TYPE = PROC [queue: Queue, pending: LIST OF Request, clientData: REF ANY]; Create: PROC [ priority: Process.Priority _ Process.priorityBackground, idleNotifier: NotifierProc _ NIL, clientData: REF ANY _ NIL] RETURNS [Queue]; Empty: PROC [queue: Queue] RETURNS [BOOL]; Abort: PROC [queue: Queue]; Enqueue: PROC [queue: Queue, request: Request]; OpTerminationInteraction: TYPE = RECORD [ op: RequestedOp, dfFile: ROPE, filesActedUpon: INT, errors: INT, warnings: INT ]; END. VDFOperationsQueue.mesa last edited by Levin on December 6, 1983 9:22 am This interface implements an asynchronous interface to the facilities defined in DFOperations. The central idea is a Queue, which is simply an ordered list of calls to be made on procedures in DFOperations. The calls in a given queue are executed in the order that they were entered on the queue; multiple queues proceed independently. This procedure creates and returns a queue. Requests to the DFOperations interface may be placed on the queue by calling `Enqueue'. If a non-NIL 'idleNotifier' is provided, it will be invoked when the 'queue' is empty, which may occur because all requests have been completed or because 'Abort' has been invoked. This procedure returns TRUE iff 'queue' has no pending requests. The queue is emptied without the requests being executed and the queue's idleNotifier, if any, is invoked with the list of unexecuted requests as a parameter. Note that the operation at the head of the list may have been partially executed. The specified request is appended to the queue. The 'interact' DFOperations.InteractionProc passed in a Request should be prepared to handle the following interaction in addition to the ones defined in the DFOperations interface. This interaction occurs when a queued operation completes, either normally or abnormally. 'op' and 'dfFile' define the operation; 'filesActedUpon', 'errors', and 'warnings' summarize the outcome. These last three values are the return values from the operation in DFOperations' corresponding to 'op' (applied to 'dfFile'). No 'response' is expected. Ê”˜Jšœ™Jšœ0™0J˜šÏk ˜ Jšœ œC˜UJšœœœ˜Jšœœ ˜-Jšœœœ˜—J˜Jšœœ œ˜&J˜Jš˜J˜Jšœ˜J˜Jšœœœ˜J˜JšœÑ™ÑJ˜Jšœœœ ˜Jšœ œ˜J˜Jšœ œ˜0J˜Jšœ œœ˜"šœœœ˜Jšœœ˜ JšœœÏc5˜BJšœ˜Jšœœœ˜Jšœ œœ˜šœ œ˜'JšœH˜HJšœ%˜%Jšœ œ˜Jš˜—J˜—J˜JšÏn œœœœœœœ˜XJ˜šŸœœ˜Jšœ8˜8Jš œœœœœ˜