-
Notifications
You must be signed in to change notification settings - Fork 34
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Concurrent Translations #1037
base: main
Are you sure you want to change the base?
Concurrent Translations #1037
Conversation
714c479
to
37695b4
Compare
6983993
to
8fceacb
Compare
d9455d0
to
93726b9
Compare
8fceacb
to
73be763
Compare
Fixed rebase of |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't understand this design at all. As far as I can tell, a half-dozen places in the code all special-case on whether the job is a translation job or not, and the user of server.rkt
also has to know what kind of job they're requesting. Why?
(define verbose #f) ; Maybe change to log-level and use 'verbose? | ||
(define verbose #t) ; Maybe change to log-level and use 'verbose? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why did this change? Debugging gunk?
|
||
(struct translate-job (fpcore to-language) #:prefab) | ||
|
||
(define (_create-job0 server-action-type associated-type) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why does this have to have such an ugly name? Why not just create-job
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also why does this function even exist? Its whole goal is just creating a server-action
struct?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And also why is the user of server.rkt
responsible for knowing which actions go to the thread and which ones are done immediately?
@@ -87,6 +101,7 @@ | |||
(log "Getting result for job: ~a.\n" job-id) | |||
(manager-ask 'result job-id)) | |||
|
|||
; Invlaid to ask for timeline of a 'translate job. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
; Invlaid to ask for timeline of a 'translate job. | |
; Invalid to ask for timeline of a 'translate job. |
src/api/server.rkt
Outdated
@@ -119,26 +146,99 @@ | |||
|
|||
(define (manager-tell msg . args) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is manager-tell
special-casing start
behavior? The user doesn't call manager-tell
!
src/api/server.rkt
Outdated
(not (sync/timeout 0 manager-dead-event))) | ||
(if manager | ||
(not (sync/timeout 0 manager-dead-event)) | ||
#t)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Gotta merge with main
, I think this part of the diff is all from no-place
being merged.
1979a2f
to
e34c789
Compare
This PR moves the translation functions "inside" of the server. Currently, all translations are done on the "main thread" which is also where the server manager is handling requests sent to the server. This creates a potential bottleneck slowing down responses to consumers of Herbie's web API like Odyssey.