1.5 API for Parallel Builds
library provides the parallel-compilation
functionality of raco setup
and raco make
Both parallel-compile-files and parallel-compile log messages
to the topic 'setup/parallel-build at the level 'info. These
messages are instances of a parallel-compile-event prefab structure:
(struct parallel-compile-event (worker event) #:prefab)
utility function is used by raco make
compile a list of paths in parallel. The optional
argument specifies the number of compile workers to spawn during
parallel compilation. The compile workers are implemented as Racket places if use-places?
is true, otherwise the compile workers are implemented as separate
Racket processes. The callback, handler
, is called with the symbol
as the handler-type
argument for each successfully compiled file,
successful compilation produces stdout/stderr output, 'error
compilation error has occurred, or 'fatal-error
when a unrecoverable
error occurs. The other arguments give more information for each status update.
The return value is (void)
if it was successful, or #f
if there was an error.
| #:worker-count 4|
| (lambda (type work msg out err)|
| (match type|
| ['done (when (verbose) (printf " Made ~a\n" work))]|
| ['output (printf " Output from: ~a\n~a~a" work out err)]|
| [_ (printf " Error compiling ~a\n~a\n~a~a"|
Changed in version 22.214.171.124 of package base: Added the #:use-places? argument.
|(parallel-compile|| ||worker-count|| || || || |
| || ||setup-fprintf|| || || || |
| || ||append-error|| || || || |
| || ||collects-tree|| || || || |
| || [||#:use-places? use-places?])|| ||→|| ||(void)|
| worker-count : non-negative-integer?|
| collects-tree : (listof any/c)|
| use-places? : any/c = #t|
function is used by raco setup
compile collections in parallel. The worker-count
specifies the number of compilation workers to spawn during parallel
compilation. The use-places?
argument specified whether
to use places, otherwise separate processes
are used. The setup-fprintf
functions communicate intermediate compilation results and errors. The
argument is a compound data structure containing
an in-memory tree representation of the collects directory.
When the exn argument to append-error is a pair of
strings, the first string is a long form of the error message, and the
second string is a short form (omitting evaluation context
information, for example).
Changed in version 126.96.36.199 of package base: Changed append-error to allow
a pair of error strings.
Changed in version 188.8.131.52: Added the #:use-places? argument.