; TODO preserve order of elements OR communicate that reorder is expected
; TODO switch from mailboxes to channels
(define (make-worker id f)
; TODO preserve order of elements OR communicate that reorder is expected
; TODO switch from mailboxes to channels
(define (make-worker id f)
(define threads (map (λ (id) (thread (make-worker id f))) workers))
(define results (dispatch workers xs '()))
(for-each thread-wait threads)
(define threads (map (λ (id) (thread (make-worker id f))) workers))
(define results (dispatch workers xs '()))
(for-each thread-wait threads)
['single-line
(printf "~a \033[1;37m<~a>\033[0m \033[0;~am~a\033[0m~n"
(parameterize ([date-display-format 'iso-8601])
['single-line
(printf "~a \033[1;37m<~a>\033[0m \033[0;~am~a\033[0m~n"
(parameterize ([date-display-format 'iso-8601])
nick color text)]
['multi-line
(printf "~a (~a)~n\033[1;37m<~a ~a>\033[0m~n\033[0;~am~a\033[0m~n~n"
(parameterize ([date-display-format 'rfc2822])
nick color text)]
['multi-line
(printf "~a (~a)~n\033[1;37m<~a ~a>\033[0m~n\033[0;~am~a\033[0m~n~n"
(parameterize ([date-display-format 'rfc2822])
[actual (str->msg nick uri (string-append ts tab text))]
[expected (msg 1605756129 ts nick uri text)])
(check-equal?
[actual (str->msg nick uri (string-append ts tab text))]
[expected (msg 1605756129 ts nick uri text)])
(check-equal?
; TODO timeline contract : time-sorted list of messages
(: timeline-read (-> Timeline-Order (Listof Feed) (Listof Msg)))
; TODO timeline contract : time-sorted list of messages
(: timeline-read (-> Timeline-Order (Listof Feed) (Listof Msg)))
- (let ([num_workers 15]) ; 15 was fastest out of the tried: 1, 5, 10, 20.
+ (let ([num-workers 15]) ; 15 was fastest out of the tried: 1, 5, 10, 20.