examples/flink: create a job from a file
Doesn't handle punctuation properly
This commit is contained in:
parent
fb778ab1ee
commit
bb028b1af8
|
@ -389,6 +389,13 @@
|
||||||
(define (string->job s)
|
(define (string->job s)
|
||||||
(create-job (open-input-string s)))
|
(create-job (open-input-string s)))
|
||||||
|
|
||||||
|
;; PathString -> Job
|
||||||
|
(define (file->job path)
|
||||||
|
(define in (open-input-file path))
|
||||||
|
(define j (create-job in))
|
||||||
|
(close-input-port in)
|
||||||
|
j)
|
||||||
|
|
||||||
(module+ test
|
(module+ test
|
||||||
(test-case
|
(test-case
|
||||||
"two-line job parsing"
|
"two-line job parsing"
|
||||||
|
@ -440,7 +447,7 @@
|
||||||
;; expected:
|
;; expected:
|
||||||
;; #hash((a . 5) (b . 5) (c . 2))
|
;; #hash((a . 5) (b . 5) (c . 2))
|
||||||
|
|
||||||
(spawn-client j)
|
(spawn-client (file->job "lorem.txt"))
|
||||||
(spawn-job-manager)
|
(spawn-job-manager)
|
||||||
(spawn-task-manager)
|
(spawn-task-manager)
|
||||||
(spawn-task-runner)
|
(spawn-task-runner)
|
||||||
|
|
Loading…
Reference in New Issue