Skip to content

Conversation

@aantron
Copy link

@aantron aantron commented Jun 12, 2017

  • Adjusts dispatch and helpers so that they do not write to the request fd. Instead, they return lists of writing operations, to be performed by the same outer code that reads from the fd, and calls dispatch.
  • Exposes the fd in the API.

| exn ->
log_error ("Unknown exception caught: "^(Printexc.to_string exn));
IO.(Out.write_error log_error req Errno.EIO
>>= fun () -> fail exn)
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FYI this line is the only reason why requests return a response list, instead of just a single response.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah yes, this mechanism is rather messy... I think it can probably be simplified but continue your work as-is for now.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One option for faithfully encoding this without a list is to add another variand, something like `Error_and_raise _.

aantron added 2 commits June 19, 2017 10:01
Signed-off-by: Anton Bachin <antonbachin@yahoo.com>
Signed-off-by: Anton Bachin <antonbachin@yahoo.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants