Last active
August 29, 2015 14:25
-
-
Save laurentpetit/5ba6ac5346fb9ee24657 to your computer and use it in GitHub Desktop.
working on the API part of CCW. First, facilities to have code executed on the UI thread, asynchronously and non blocking, or blocking (synchronously or asynchronously)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; Which solution would be preferred as an API over SWT Display.syncExec Display.asyncExec ? | |
;; In java you do this: | |
;; Display.syncExec( -> ...) | |
;; Display.asyncExec( -> ...) | |
(require '[ccw.swt :as swt]) | |
;; O | |
(swt/sync-exec | |
... macro body ...) | |
(swt/async-exec | |
... macro body ...) | |
(swt/sync-exec* function) | |
(swt/async-exec* function) | |
;; 1 | |
(swt/sync | |
... macro body ...) | |
(swt/async | |
... macro body ...) | |
(swt/sync* function) | |
(swt/async* function) | |
;; 1a | |
(swt/do-sync | |
... macro body ...) | |
(swt/do-async | |
... macro body ...) | |
(swt/sync function) | |
(swt/async function) | |
;; 2 | |
(swt/ui-sync | |
... macro body ...) | |
(swt/ui-async | |
... macro body ...) | |
(swt/ui-sync* function) | |
(swt/ui-async* function) | |
;; 3 | |
(swt/display-sync | |
... macro body ...) | |
(swt/display-async | |
... macro body ...) | |
(swt/display-sync* function) | |
(swt/display-async* function) | |
;; 4 | |
(swt/do-display-sync | |
... macro body ...) | |
(swt/do-display-async | |
... macro body ...) | |
(swt/display-sync function) | |
(swt/display-async function) | |
;; variants with pending ! to indicate I/O ? | |
;; O | |
(swt/sync-exec! | |
... macro body ...) | |
(swt/async-exec! | |
... macro body ...) | |
(swt/sync-exec!* function) | |
(swt/async-exec!* function) | |
;; V1 | |
(swt/sync! | |
... macro body ...) | |
(swt/async! | |
... macro body ...) | |
(swt/sync!* function) | |
(swt/async!* function) | |
;; V1a | |
(swt/do-sync | |
... macro body ...) | |
(swt/doasync | |
... macro body ...) | |
(swt/sync! function) | |
(swt/async! function) | |
;; V2 | |
(swt/ui-sync! | |
... macro body ...) | |
(swt/ui-async! | |
... macro body ...) | |
(swt/ui-sync!* function) | |
(swt/ui-async!* function) | |
;; V3 | |
(swt/display-sync! | |
... macro body ...) | |
(swt/display-async! | |
... macro body ...) | |
(swt/display-sync!* function) | |
(swt/display-async!* function) | |
;; V4 | |
(swt/do-display-sync ;; or do-display-sync! ? | |
... macro body ...) | |
(swt/do-display-async | |
... macro body ...) | |
(swt/display-sync! function) | |
(swt/display-async! function) |
For the functions, I like:
(swt/sync! function)
(swt/async! function)
For macro:
(swt/do-sync
... macro body ...)
(swt/do-async
... macro body ...)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I don't know shit about clojure and SWT, but since SWT's Display class uses
syncExec
andasyncExec
, I'd choose the same terminology.