Re: [racket-users] implementing make in racket

2017-02-02 Thread Matthias Felleisen
(And you also want to catch all exns at that points and put them into ch. But I suspect you’d have known.) > On Feb 2, 2017, at 9:11 AM, Jay McCarthy wrote: > > I would do something like: > > (define ch (make-channel)) > (submit-job! jq (lambda () (define ans ...)

Re: [racket-users] implementing make in racket

2017-02-02 Thread Jay McCarthy
I would do something like: (define ch (make-channel)) (submit-job! jq (lambda () (define ans ...) (channel-put ch ans))) (channel-get ch ans) This will synchronously wait for the job to finish. Presumably you'd do this when you already started up the workers and from a context where you have a

Re: [racket-users] implementing make in racket

2017-02-01 Thread Dan Liebgold
On Wednesday, November 30, 2016 at 10:38:05 AM UTC-8, Jay McCarthy wrote: > The typed-racket code returns a value from the job, whereas this code > assumes the job is fully self-contained. Perhaps job-queue should > protect itself from job exceptions. > BTW, how would you recommend returning a

Re: [racket-users] implementing make in racket

2016-11-30 Thread Dan Liebgold
On Wednesday, November 30, 2016 at 1:49:04 PM UTC-8, Jay McCarthy wrote: > I just pushed a fix for this, btw. > > Awesome, thanks! -- You received this message because you are subscribed to the Google Groups "Racket Users" group. To unsubscribe from this group and stop receiving emails from

Re: [racket-users] implementing make in racket

2016-11-30 Thread Jay McCarthy
I just pushed a fix for this, btw. Jay On Wed, Nov 30, 2016 at 2:15 PM, Dan Liebgold wrote: > On Wednesday, November 30, 2016 at 10:38:05 AM UTC-8, Jay McCarthy wrote: > > The typed-racket code returns a value from the job, whereas this code > > assumes the job is

Re: [racket-users] implementing make in racket

2016-11-30 Thread Dan Liebgold
On Wednesday, November 30, 2016 at 10:38:05 AM UTC-8, Jay McCarthy wrote: > The typed-racket code returns a value from the job, whereas this code > assumes the job is fully self-contained. Perhaps job-queue should > protect itself from job exceptions. > Probably a good idea. I got confused

Re: [racket-users] implementing make in racket

2016-11-30 Thread Jay McCarthy
The typed-racket code returns a value from the job, whereas this code assumes the job is fully self-contained. Perhaps job-queue should protect itself from job exceptions. On Wed, Nov 30, 2016 at 1:30 PM, Dan Liebgold wrote: > On Tuesday, November 29, 2016 at 6:30:08

Re: [racket-users] implementing make in racket

2016-11-30 Thread Dan Liebgold
On Tuesday, November 29, 2016 at 6:30:08 PM UTC-8, David K. Storrs wrote: > > Can you simply catch it and handle it inside the thunk? >   That's probably best. I was looking at the machinery to serialize exceptions in type racket* and thinking I needed that *:

Re: [racket-users] implementing make in racket

2016-11-29 Thread David Storrs
On Tue, Nov 29, 2016 at 4:22 PM, Dan Liebgold wrote: > On Tuesday, November 29, 2016 at 3:32:48 PM UTC-8, Jay McCarthy wrote: > > Wow, that's a lame error that has been there for a LONG time. I just > > pushed a fix. > > > > Got it. > > Any advice for how to handle

Re: [racket-users] implementing make in racket

2016-11-29 Thread Dan Liebgold
On Tuesday, November 29, 2016 at 3:32:48 PM UTC-8, Jay McCarthy wrote: > Wow, that's a lame error that has been there for a LONG time. I just > pushed a fix. > Got it. Any advice for how to handle when a job thunk raises an exception? Currently (stop-job-queue! jq) waits forever... -- You

Re: [racket-users] implementing make in racket

2016-11-29 Thread Jay McCarthy
Wow, that's a lame error that has been there for a LONG time. I just pushed a fix. On Tue, Nov 29, 2016 at 6:15 PM, Dan Liebgold wrote: > On Tuesday, November 29, 2016 at 12:23:32 PM UTC-8, Jay McCarthy wrote: >> DrDr uses job-queue for a similar process >> >>

Re: [racket-users] implementing make in racket

2016-11-29 Thread Dan Liebgold
On Tuesday, November 29, 2016 at 12:23:32 PM UTC-8, Jay McCarthy wrote: > DrDr uses job-queue for a similar process > > http://docs.racket-lang.org/job-queue/index.html > Looks promising. However, the docs say that stop-job-queue! will block until jobs are done... and this code doesn't wait:

Re: [racket-users] implementing make in racket

2016-11-29 Thread Sam Tobin-Hochstadt
Typed Racket uses this code: https://github.com/racket/typed-racket/blob/master/typed-racket-test/send-places.rkt to manage a job queue for testing. Sam On Tue, Nov 29, 2016 at 3:23 PM, Jay McCarthy wrote: > DrDr uses job-queue for a similar process > >

Re: [racket-users] implementing make in racket

2016-11-29 Thread Jay McCarthy
DrDr uses job-queue for a similar process http://docs.racket-lang.org/job-queue/index.html Jay On Tue, Nov 29, 2016 at 2:22 PM, Dan Liebgold wrote: > I find myself implementing make (or something similar) in Racket... can > anyone point to a good example of the