Skip to content
This repository has been archived by the owner on Jan 14, 2020. It is now read-only.

Synchronous channels #4

Open
esad opened this issue Jan 12, 2020 · 1 comment
Open

Synchronous channels #4

esad opened this issue Jan 12, 2020 · 1 comment

Comments

@esad
Copy link

esad commented Jan 12, 2020

JoCaml also provides synchronous channels, which would be useful in Jolog as well. I guess the ideal interface would be to communicate the results back via variables - so I naively tried to sendsomething like get_result(X) then assign value(s) to X in the body of jolog clause. However as messages are sent using queues and those copy terms, the reference to original variable is lost. I guess something like https://github.com/mndrix/spawn could be used?

@mndrix Do you have any thoughts about this?

@mndrix
Copy link
Owner

mndrix commented Jan 14, 2020

Synchronous channels can definitely be useful. I don't have a great idea how to incorporate them into the jolog package. I've been away from Prolog for a while, but I seem to recall that SWI-Prolog only has asynchronous channels, you have to implement synchronous channels by sending an asynchronous message then immediately waiting for it. I hope that's helpful in some way.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants