Hello,
I am using a client written in C#. For the sake of this discussion, imagine the app being discussed as an app just like the Java GUI app that ships with BaseX: You can basically author Xquery snippets and
send them for execution by the server.
We regularly have queries that tend to run for a long time, and it would be an advantage for the user to be able to cancel these long running jobs, just like he can in the GUI app. However, I am not sure how
to do this; I can imagine two solutions:
I see some traces of an eventing mechanism that was deprecated (or at least no longer included in the client). That is what I would ideally have (ignoring bindings etc):
Query q = new Query(“1 to 10” , new Guid());
q.Ended += MyTerminationHandler(); // C# syntax for adding an event handler for termination
q.Interrupted += MyInterruptedHandler();
await q.execute();
// Called when the query has terminated with a result
void MyTerminationHandler(Guid g, string result) { ... update UI … }
// Called when the query has terminated with a result
void MyInterruptedHandler (Guid g) { ... update UI … }
How do I do this without the polling, being able to pass massive results and queries back and forth?
Best Regards
Peter Villadsen
Principal Architect
Microsoft Business Applications Group