Run Goal on a JSON RPC service identified by Stream and wait for
Result. This predicate may be called from multiple threads. As
replies come in in arbitrary order, this predicate starts a thread
the reads the replies from Stream and informs the calling thread
using a Prolog message queue.
If Stream is closed this library terminates the thread and related
message queue.
- Arguments:
-
| Goal | - is a callable term. The functor name is the method. If
there is a single argument that is a dict, we invoke a JSON-RPC
method using named arguments. If there is a single argument that
is a list, use the elements of the list as positional arguments.
If there are zero or more than one arguments use these as
positional arguments. Examples:
| Term | Method | Type | JSON (params) |
f(#{a:1,b:2}) | f | named | {"a":1, "b":2} |
f(["a", 42]) | f | positional | ["a", 42] |
| f([#{"a":1}]) | f | positional | [{"a":1}] |
f() | f | positional | [] |
f("a", 42) | f | positional | ["a", 42] |
Options processed: |