Skip to content

Commit 86983bc

Browse files
committed
drop now arg from event callback
1 parent 44696fd commit 86983bc

File tree

11 files changed

+88
-88
lines changed

11 files changed

+88
-88
lines changed

src/dryad.lisp

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@
5959
;;;
6060

6161
(define-message-handler handler-message-sow
62-
((dryad dryad) (message message-sow) now)
62+
((dryad dryad) (message message-sow))
6363
"Adjoin a new node to the problem graph.
6464
6565
NOTE: In the basic implementation, these messages must be waiting for the DRYAD on launch."
@@ -72,12 +72,12 @@ NOTE: In the basic implementation, these messages must be waiting for the DRYAD
7272
(log-entry :entry-type 'handling-sow
7373
:address node-address
7474
:id node-id)
75-
(schedule node-process now)
75+
(schedule node-process (now))
7676
(setf (gethash node-address (dryad-ids dryad)) node-id
7777
(gethash node-address (dryad-sprouted? dryad)) nil)))
7878

7979
(define-message-handler handler-message-discover
80-
((dryad dryad) (message message-discover) now)
80+
((dryad dryad) (message message-discover))
8181
"Handles a DISCOVER message, sent by a BLOSSOM-NODE which expects a list of other BLOSSOM-NODE addresses to which it should send PINGs."
8282
(let ((channels
8383
(loop :for address :being :the :hash-keys :of (dryad-ids dryad)
@@ -91,7 +91,7 @@ NOTE: In the basic implementation, these messages must be waiting for the DRYAD
9191
:id (message-discover-id message)))))
9292

9393
(define-message-handler handler-message-sprout
94-
((dryad dryad) (message message-sprout) now)
94+
((dryad dryad) (message message-sprout))
9595
"Handles a SPROUT message, indicating that a BLOSSOM-NODE has been matched (for the first time)."
9696
(with-slots (address) message
9797
(a:when-let ((id (gethash address (dryad-ids dryad))))
@@ -101,7 +101,7 @@ NOTE: In the basic implementation, these messages must be waiting for the DRYAD
101101
(setf (gethash address (dryad-sprouted? dryad)) t))))
102102

103103
(define-rpc-handler handler-message-wilting
104-
((dryad dryad) (message message-wilting) now)
104+
((dryad dryad) (message message-wilting))
105105
"Handles a wilting message, indicating that a BLOSSOM-NODE is dying."
106106
(with-slots (address) message
107107
(let ((id (gethash address (dryad-ids dryad))))
@@ -123,11 +123,11 @@ NOTE: In the basic implementation, these messages must be waiting for the DRYAD
123123
;;; DRYAD command definitions
124124
;;;
125125

126-
(define-process-upkeep ((dryad dryad) now) (START)
126+
(define-process-upkeep ((dryad dryad)) (START)
127127
"Start listening for ripe sprouted pairs."
128128
(process-continuation dryad `(SPROUTS-LOOP)))
129129

130-
(define-process-upkeep ((dryad dryad) now) (SPROUTS-LOOP)
130+
(define-process-upkeep ((dryad dryad)) (SPROUTS-LOOP)
131131
"Loop over sprouted nodes, looking for ripe pairs."
132132
;; if not everyone is sprouted, hold off
133133
;; NB: the loop returns T if the hash table is empty, so we additionally
@@ -188,7 +188,7 @@ NOTE: In the basic implementation, these messages must be waiting for the DRYAD
188188
`(PROCESS-PAIRS ,pairs)
189189
`(WIND-DOWN)))))))
190190

191-
(define-process-upkeep ((dryad dryad) now) (PROCESS-PAIRS pairs)
191+
(define-process-upkeep ((dryad dryad)) (PROCESS-PAIRS pairs)
192192
"Iterates through `PAIRS' of addresses and sends corresponding WILT and REAP messages."
193193
(dolist (address-pair pairs)
194194
(log-entry :entry-type 'processing-pair
@@ -199,7 +199,7 @@ NOTE: In the basic implementation, these messages must be waiting for the DRYAD
199199
(send-message (dryad-match-address dryad)
200200
(make-message-reap :ids id-pair)))))
201201

202-
(define-process-upkeep ((dryad dryad) now) (SEND-EXPAND sprout)
202+
(define-process-upkeep ((dryad dryad)) (SEND-EXPAND sprout)
203203
"Directs SPROUT to perform blossom expansion."
204204
(unless (process-lockable-aborting? dryad)
205205
;; if we directly send the sprout a blossom-expand message, it will
@@ -225,6 +225,6 @@ NOTE: In the basic implementation, these messages must be waiting for the DRYAD
225225
(expand-reply topmost)
226226
nil)))))))
227227

228-
(define-process-upkeep ((dryad dryad) now) (WIND-DOWN &optional (counter 50))
228+
(define-process-upkeep ((dryad dryad)) (WIND-DOWN &optional (counter 50))
229229
(unless (zerop counter)
230230
(process-continuation dryad `(WIND-DOWN ,(1- counter)))))

src/lock.lisp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
(mapcar #'blossom-edge-target-node (union (blossom-node-petals node)
1313
(blossom-node-children node))))
1414

15-
(define-process-upkeep ((node blossom-node) now)
15+
(define-process-upkeep ((node blossom-node))
1616
(aether::%FINISH-UNLOCK)
1717
(setf (blossom-node-pingable node) ':ALL)
1818
(setf (blossom-node-held-by-roots node) nil)
@@ -27,7 +27,7 @@
2727
;;;
2828

2929
(define-message-handler handle-message-lock
30-
((node blossom-node) (message message-lock) now)
30+
((node blossom-node) (message message-lock))
3131
"Prepares a BLOSSOM-NODE to be locked."
3232
(when (blossom-node-wilting node)
3333
(send-message (message-reply-channel message)
@@ -41,7 +41,7 @@
4141
;;; supervisor command definitions
4242
;;;
4343

44-
(define-process-upkeep ((supervisor supervisor) now)
44+
(define-process-upkeep ((supervisor supervisor))
4545
(BROADCAST-UNLOCK &key destroy? &allow-other-keys)
4646
"Cleans up after BROADCAST-LOCK."
4747
(with-slots (aborting? done-signal downward-rx-latches downward-tx-latches upward-tx-latch) supervisor

src/node.lisp

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,7 @@ evalutes to
282282
(if (string< x y) x y)))
283283

284284
(define-message-subordinate handle-message-id-query
285-
((node blossom-node) (message message-id-query) now)
285+
((node blossom-node) (message message-id-query))
286286
"Replies with the minimum ID at this macrovertex."
287287
(cond
288288
((null (blossom-node-petals node))
@@ -306,7 +306,7 @@ evalutes to
306306
;; tree to respond to a safe subset (or to all) of PING requests.
307307

308308
(define-broadcast-handler handle-message-broadcast-pingability
309-
((node blossom-node) (message message-broadcast-pingability) now)
309+
((node blossom-node) (message message-broadcast-pingability))
310310
"Changes the pingability of `NODE' (and children / petals) to `PING-TYPE'."
311311
(with-slots (ping-type) message
312312
(log-entry :entry-type 'changing-pingability
@@ -325,7 +325,7 @@ evalutes to
325325
;; better to implement the micromessages after all.
326326

327327
(define-rpc-handler handle-message-set
328-
((node blossom-node) (message message-set) now)
328+
((node blossom-node) (message message-set))
329329
"Handles a remote SETF request."
330330
(with-slots (slots values) message
331331
(loop :for slot :in slots
@@ -334,14 +334,14 @@ evalutes to
334334
(values)))
335335

336336
(define-rpc-handler handle-message-push
337-
((node blossom-node) (message message-push) now)
337+
((node blossom-node) (message message-push))
338338
"Handles a remote PUSH request."
339339
(with-slots (slot value) message
340340
(push value (slot-value node slot))
341341
(values)))
342342

343343
(define-rpc-handler handle-message-values
344-
((node blossom-node) (message message-values) now)
344+
((node blossom-node) (message message-values))
345345
"Handles a remote request for data."
346346
(with-slots (values) message
347347
(loop :for value :in values
@@ -355,7 +355,7 @@ evalutes to
355355
;; and should halt its process.
356356

357357
(define-message-handler handle-message-sprout-on-blossom
358-
((node blossom-node) (message message-sprout) now)
358+
((node blossom-node) (message message-sprout))
359359
"Handles a request that a root node (perhaps not a vertex) alert the DRYAD that it has sprouted."
360360
(cond
361361
((blossom-node-petals node)
@@ -367,7 +367,7 @@ evalutes to
367367
(make-message-sprout :address (process-public-address node))))))
368368

369369
(define-message-handler handle-message-wilt
370-
((node blossom-node) (message message-wilt) now)
370+
((node blossom-node) (message message-wilt))
371371
;; sanity check: are we actually allowed to wilt?
372372
(when (or (blossom-node-parent node)
373373
(blossom-node-pistil node)
@@ -443,11 +443,11 @@ evalutes to
443443
;;; basic command definitions for BLOSSOM-NODE
444444
;;;
445445

446-
(define-process-upkeep ((node blossom-node) now) (START)
446+
(define-process-upkeep ((node blossom-node)) (START)
447447
"Blossom nodes represent (contracted subgraphs of) vertex(es). The START command drops the blossom node into an infinite loop, SCAN-LOOP, which enacts the basic behavior."
448448
(process-continuation node `(SCAN-LOOP)))
449449

450-
(define-process-upkeep ((node blossom-node) now) (SCAN-LOOP &optional repeat?)
450+
(define-process-upkeep ((node blossom-node)) (SCAN-LOOP &optional repeat?)
451451
"If we're out of things to do & unmatched, consider starting a SCAN. If REPEAT? is set, then this is _not_ our first time trying to SCAN to find something to do, and the previous attempt(s) resulted in no action."
452452
(unless (blossom-node-wilting node)
453453
(process-continuation node `(SCAN-LOOP))
@@ -466,7 +466,7 @@ evalutes to
466466
:repeat? repeat?)))
467467
(process-continuation node `(START-SCAN ,scan-message)))))
468468

469-
(define-process-upkeep ((node blossom-node) now) (IDLE)
469+
(define-process-upkeep ((node blossom-node)) (IDLE)
470470
(unless (blossom-node-wilting node)
471471
(process-continuation node `(IDLE))
472472
(wake-on-network)))

src/operations/augment.lisp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
;;; supervisor command definitions
4444
;;;
4545

46-
(define-process-upkeep ((supervisor supervisor) now) (START-AUGMENT pong)
46+
(define-process-upkeep ((supervisor supervisor)) (START-AUGMENT pong)
4747
"Sets up the augmentation procedure."
4848
(with-slots (edges source-root target-root) pong
4949
(let* ((edge (first edges))
@@ -59,7 +59,7 @@
5959
`(BROADCAST-UNLOCK :destroy? ,T)
6060
`(HALT)))))
6161

62-
(define-process-upkeep ((supervisor supervisor) now) (AUGMENT edge)
62+
(define-process-upkeep ((supervisor supervisor)) (AUGMENT edge)
6363
"Perform an augmentation along a given edge."
6464
(unless (process-lockable-aborting? supervisor)
6565
(log-entry :entry-type 'augment
@@ -82,7 +82,7 @@
8282
;;;
8383

8484
(define-message-handler handle-message-percolate
85-
((node blossom-node) (message message-percolate) now)
85+
((node blossom-node) (message message-percolate))
8686
"Performs a step in the path augmentation process."
8787
(with-slots (traversal-edge reply-channel) message
8888
;; does the previous node expect me to link to it?

src/operations/contract.lisp

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ PETAL-CHILD-EDGES: The list of child edges attached to the blossoms in the subtr
7878
;;; supervisor command definitions
7979
;;;
8080

81-
(define-process-upkeep ((supervisor supervisor) now) (START-CONTRACT pong)
81+
(define-process-upkeep ((supervisor supervisor)) (START-CONTRACT pong)
8282
"Begins the CONTRACT routine, sets up the stack frames."
8383
(with-slots (source-root) pong
8484
(let ((targets (list source-root)))
@@ -93,7 +93,7 @@ PETAL-CHILD-EDGES: The list of child edges attached to the blossoms in the subtr
9393
`(BROADCAST-UNLOCK)
9494
`(HALT)))))
9595

96-
(define-process-upkeep ((supervisor supervisor) now) (START-INNER-CONTRACT)
96+
(define-process-upkeep ((supervisor supervisor)) (START-INNER-CONTRACT)
9797
"Begins the critical section of the CONTRACT routine."
9898
(unless (process-lockable-aborting? supervisor)
9999
(let* ((supervisor-frame (peek (process-data-stack supervisor)))
@@ -102,7 +102,7 @@ PETAL-CHILD-EDGES: The list of child edges attached to the blossoms in the subtr
102102
;; prevent SCANs
103103
:paused? t
104104
:debug? (process-debug? supervisor))))
105-
(schedule fresh-blossom now)
105+
(schedule fresh-blossom (now))
106106
(log-entry :entry-type 'spawned-fresh-blossom
107107
:fresh-blossom fresh-blossom)
108108
(push (make-data-frame-contract
@@ -120,20 +120,20 @@ PETAL-CHILD-EDGES: The list of child edges attached to the blossoms in the subtr
120120
`(BROADCAST-UNLOCK) ; NOTE: double-calling BROADCAST-UNLOCK makes
121121
`(RELEASE-STOWED-LOCK))))) ; the second one a NOP.
122122

123-
(define-process-upkeep ((supervisor supervisor) now) (STOW-LOCK)
123+
(define-process-upkeep ((supervisor supervisor)) (STOW-LOCK)
124124
(with-slots (downward-rx-latches downward-tx-latches) supervisor
125125
(with-slots (stowed-rx-latch stowed-tx-latch) (peek (process-data-stack supervisor))
126126
(setf stowed-rx-latch (pop downward-rx-latches)
127127
stowed-tx-latch (pop downward-tx-latches)))))
128128

129-
(define-process-upkeep ((supervisor supervisor) now) (RELEASE-STOWED-LOCK)
129+
(define-process-upkeep ((supervisor supervisor)) (RELEASE-STOWED-LOCK)
130130
(with-slots (downward-rx-latches downward-tx-latches) supervisor
131131
(with-slots (stowed-rx-latch stowed-tx-latch) (pop (process-data-stack supervisor))
132132
(push stowed-rx-latch downward-rx-latches)
133133
(push stowed-tx-latch downward-tx-latches)
134134
(process-continuation supervisor `(BROADCAST-UNLOCK)))))
135135

136-
(define-process-upkeep ((supervisor supervisor) now) (COMPUTE-BLOSSOM-PATHS)
136+
(define-process-upkeep ((supervisor supervisor)) (COMPUTE-BLOSSOM-PATHS)
137137
"This command computes the cycle which will constitute the fresh blossom.
138138
139139
G <-- root --> G
@@ -211,7 +211,7 @@ Both above tree diagrams are valid arrangments that would trigger this operation
211211
(list (copy-blossom-edge edge))
212212
(reverse-blossom-edges recipient-tail)))))))
213213

214-
(define-process-upkeep ((supervisor supervisor) now) (HANDLE-PISTIL)
214+
(define-process-upkeep ((supervisor supervisor)) (HANDLE-PISTIL)
215215
"Tell the source of the peduncle edge that the fresh blossom is its child.
216216
217217
G <-- root --> G
@@ -233,7 +233,7 @@ If we have a non-null peduncle edge (F -> C above), then we need to tell its sou
233233
(attach-result (blossom-edge-source-node peduncle-edge))
234234
nil)))))
235235

236-
(define-process-upkeep ((supervisor supervisor) now) (HANDLE-PETALS)
236+
(define-process-upkeep ((supervisor supervisor)) (HANDLE-PETALS)
237237
"Tell the blossom's petals what's up."
238238
(with-slots (path fresh-blossom petal-child-edges) (peek (process-data-stack supervisor))
239239
(let ((children (mapcar #'blossom-edge-target-node path)))
@@ -248,7 +248,7 @@ If we have a non-null peduncle edge (F -> C above), then we need to tell its sou
248248
:test #'address=))
249249
(apply #'append petal-child-edges petal-replies))))))))
250250

251-
(define-process-upkeep ((supervisor supervisor) now) (HANDLE-BLOSSOM-SUB-CHILDREN)
251+
(define-process-upkeep ((supervisor supervisor)) (HANDLE-BLOSSOM-SUB-CHILDREN)
252252
"Tell all the other children what's up."
253253
(with-slots (fresh-blossom petal-child-edges) (peek (process-data-stack supervisor))
254254
(let ((petal-children (mapcar #'blossom-edge-target-node petal-child-edges)))
@@ -258,7 +258,7 @@ If we have a non-null peduncle edge (F -> C above), then we need to tell its sou
258258
(send-message-batch #'payload-constructor petal-children)
259259
nil)))))
260260

261-
(define-process-upkeep ((supervisor supervisor) now) (HANDLE-NEW-BLOSSOM)
261+
(define-process-upkeep ((supervisor supervisor)) (HANDLE-NEW-BLOSSOM)
262262
"Tell the blossom itself what's up."
263263
(let ((frame (peek (process-data-stack supervisor))))
264264
(with-slots (fresh-blossom peduncle-edge path petal-child-edges) frame
@@ -310,7 +310,7 @@ If we have a non-null peduncle edge (F -> C above), then we need to tell its sou
310310
;;;
311311

312312
(define-message-handler handle-message-root-path
313-
((node blossom-node) (message message-root-path) now)
313+
((node blossom-node) (message message-root-path))
314314
"Calculates the path from a blossom through to the tree root (consisting only of toplevel blossoms)."
315315
(with-slots (path reply-channel) message
316316
(cond
@@ -327,7 +327,7 @@ If we have a non-null peduncle edge (F -> C above), then we need to tell its sou
327327
(make-message-rpc-done :result path))))))
328328

329329
(define-rpc-handler handle-message-attach-parent
330-
((node blossom-node) (message message-attach-parent) now)
330+
((node blossom-node) (message message-attach-parent))
331331
"Attaches a fresh blossom to an existing parent."
332332
(with-slots (peduncle-edge reply-channel fresh-blossom) message
333333
(assert (not (null peduncle-edge)))
@@ -346,7 +346,7 @@ If we have a non-null peduncle edge (F -> C above), then we need to tell its sou
346346
nil))
347347

348348
(define-rpc-handler handle-message-convert-child-to-petal
349-
((node blossom-node) (message message-convert-child-to-petal) now)
349+
((node blossom-node) (message message-convert-child-to-petal))
350350
"Attaches an old child to a new blossom as a petal."
351351
(with-slots (reply-channel fresh-blossom) message
352352
(prog1 (blossom-node-children node)
@@ -357,7 +357,7 @@ If we have a non-null peduncle edge (F -> C above), then we need to tell its sou
357357
(blossom-node-children node) nil))))
358358

359359
(define-rpc-handler handle-message-reattach-cycle-child
360-
((node blossom-node) (message message-reattach-cycle-child) now)
360+
((node blossom-node) (message message-reattach-cycle-child))
361361
"Attaches an old child to a new blossom as a (non-blossom-)child."
362362
(with-slots (reply-channel fresh-blossom) message
363363
(setf (blossom-edge-target-node (blossom-node-parent node))
@@ -368,7 +368,7 @@ If we have a non-null peduncle edge (F -> C above), then we need to tell its sou
368368
;; the fresh blossom responsible for setting _itself_ up. this would also
369369
;; alleviate the obnoxious problem with locking/spawning timing.
370370
(define-rpc-handler handle-message-set-up-blossom
371-
((node blossom-node) (message message-set-up-blossom) now)
371+
((node blossom-node) (message message-set-up-blossom))
372372
"Sets up a new contracting blossom's slots."
373373
(with-slots (peduncle-edge petals petal-children dryad reply-channel) message
374374
(loop :for petal-child :in petal-children

0 commit comments

Comments
 (0)