17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
|
;;(close-database db)
)))
#t))
"receive"))
(th2 (make-thread (lambda ()
(print "Jeff is here")
(let loop ((entries 0))
(thread-sleep! 0.01)
(print "Preparding to send entries" entries)
(handle-exceptions exn (begin (print "Had an issue: " (message exn))(thread-sleep! 10))
(define-values (i o) (tcp-connect "localhost" 6505))
(serialize (list "localhost:6505" "from-server-two") o)
(print (read-line i))
(close-input-port i)
(close-output-port o))
(loop (+ entries 1)))) "send"))
(th3 (make-thread (lambda ()
(print "In mailbox thread")
(let loop2 ((entries2 0))
(print "Processing: " (mailbox-receive! work-mailbox))
(mailbox-send! notify-mailbox (list 'ack))
(thread-sleep! 0.01)
(loop2 1))) "processing"))
(th4 (make-thread (lambda ()
(print "In notify-mailbox thread")
(let loop3 ((entries3 0))
(print "Notifying: " (mailbox-receive! notify-mailbox))
(handle-exceptions exn (begin (print "Had an issue: " (message exn))(thread-sleep! 10))
(define-values (i o) (tcp-connect "localhost" 6505))
|
|
|
|
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
|
;;(close-database db)
)))
#t))
"receive"))
(th2 (make-thread (lambda ()
(print "Jeff is here")
(let loop ((entries 0))
(thread-sleep! 0.8)
(print "Preparding to send entries" entries)
(handle-exceptions exn (begin (print "Had an issue: " (message exn))(thread-sleep! 10))
(define-values (i o) (tcp-connect "localhost" 6505))
(serialize (list "localhost:6505" "from-server-two") o)
(print (read-line i))
(close-input-port i)
(close-output-port o))
(loop (+ entries 1)))) "send"))
(th3 (make-thread (lambda ()
(print "In mailbox thread")
(let loop2 ((entries2 0))
(print "Processing: " (mailbox-receive! work-mailbox))
(mailbox-send! notify-mailbox (list 'ack))
(thread-sleep! 0.5)
(loop2 1))) "processing"))
(th4 (make-thread (lambda ()
(print "In notify-mailbox thread")
(let loop3 ((entries3 0))
(print "Notifying: " (mailbox-receive! notify-mailbox))
(handle-exceptions exn (begin (print "Had an issue: " (message exn))(thread-sleep! 10))
(define-values (i o) (tcp-connect "localhost" 6505))
|