From: Christopher Allan Webber Date: Thu, 8 Dec 2016 18:47:32 +0000 (-0600) Subject: agenda: Use suspendable ports feature from Guile 2.2. X-Git-Tag: v0.3.0~33 X-Git-Url: https://jxself.org/git/?p=8sync.git;a=commitdiff_plain;h=64099f71e0d685260289229a599a753923d2dc8f;hp=64099f71e0d685260289229a599a753923d2dc8f agenda: Use suspendable ports feature from Guile 2.2. This removes the old method of watching for when ports are updated via select and explicitly calling a particular function, and instead can simply suspend at the appropriate points using Guile's common I/O procedures; the agenda handles waking things up when they're ready. * 8sync/agenda.scm: Import `(ice-9 suspendable-ports)' and run install-suspendable-ports! (, agenda-except-port-map, make-agenda): Drop except-port-map from agenda. The "meaning" of read-port-map and write-port-map has changed a bit too; these are still a hash-table of a port to a procedure to be called when that port is available, but after being selected, items are removed from the table. (, make-port-request, port-request, ) (port-remove-request, 8sync-port, 8sync-port-remove) (agenda-handle-port-request!, agenda-handle-port-remove-request!): Remove. (8sync-nowait): Move comment that was previously in 8sync-port here. (update-agenda-from-select!): Update to use the new "meaning" of the agenda-read-port-map and agenda-write-port-map and to drop referencing the deprecated agenda-except-port-map. Properly removes items from the read and write maps once they've been selected. (, , agenda-handle-read-request) (agenda-handle-write-request, wait-for-readable, wait-for-writable): New variables. (stop-on-nothing-to-do): Remove check on removed agenda-except-port-map. (agenda-run-once): Parameterize the current-read-waiter and current-write-waiter to wait-for-readable and wait-for-writable respectively. Update handle-individual to use the new and types. ---