|
| Hi,
Sorry if this is off-topic, but I have tried everywhere to get help on this
and this is the most relevent newsgroup I can find.
I am writing an application which uses Sicstus Prolog as the back-end and
Java for the front-end. Java sets up a query and then uses the Sicstus'
Jasper API to get a result from Sicstus Prolog. These queries can take a
long time and I need to be able to allow the user to cancel them from the
Java interface.
My problem is that I cannot find a way to stop queries in Jasper once they
have been started. The SICStus class has a "stopServer" method, but this
does not stop all the queries when it is called like you think it would.
I have looked a variety of hacky solutions that I can use. For example,
having a callback to Java in my query inner loop which asks a Java method
periodically if it should quit or not. These types of solutions aren't
great however, because Sicstus could easily hang the whole application if
something went wrong and it increases the coupling of the two programs.
Any ideas of how I could make the Prolog query end on the users request
would be greatly appreciated.
|
|