-
I'm trying to integrate the Hyper Server backend into Scryer as part of the next generation
But I don't know exactly how to implement that kind of callback in Scryer. I've seen the |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
You'd have to implement separate system instructions for issuing the request to the server and awaiting the response, both as a matter of the WAM's design philosophy and because the borrow checker won't allow you to do otherwise. A blocking request-and-wait could be implemented as a single instruction but a non-blocking request needs at least two. Scryer is a direct threaded interpreter. As such, there is only one call stack frame belonging to For example, |
Beta Was this translation helpful? Give feedback.
You'd have to implement separate system instructions for issuing the request to the server and awaiting the response, both as a matter of the WAM's design philosophy and because the borrow checker won't allow you to do otherwise. A blocking request-and-wait could be implemented as a single instruction but a non-blocking request needs at least two.
Scryer is a direct threaded interpreter. As such, there is only one call stack frame belonging to
dispatch_loop
at any given time. Co-routining between Prolog and Rust is not really a thing, that is, a Rust function can never cede execution todispatch_loop
, let it run for a time, and then return to the point where the function yielded control to…