Or - put it into the stellar context and not need the new interface Context ctx = builder.withCancellation(token);
with the default being a never cancel token On November 16, 2016 at 16:20:04, Otto Fowler ([email protected]) wrote: public interface CancellableStellarFunction extends StellarFunction{ Object apply(List<Object> args, Context context, CancelToken token); } On November 16, 2016 at 16:02:02, Casey Stella ([email protected]) wrote: So, off the top of my head, because we are using aeshell under the hood, you can certainly get a callback on ctrl-C via the REPL settings (see https://github.com/aeshell/aesh/blob/master/src/main/java/AeshExample.java#L134 ) >From there, now that you have a hook for the ctrl-C, you shoudl be able to notify the stellar function via some way. The first thought I had is for the stellar function handler to register a callback to be called on interrupt upon initialization and for the InterruptHook to go through the callbacks and call them on interrupt. In teh callback, I'd probably set "isInterrupted" to true and have the for loop in the tail die. Warning: these are entirely half formed thoughts just to get you started down the path. Casey On Wed, Nov 16, 2016 at 3:54 PM, Nick Allen <[email protected]> wrote: > Is there any way for a user to send an interrupt-like signal in the Stellar > REPL? > > I'd like to modify the KAFKA_TAIL function so that the user can continually > read messages from a Kafka topic, rather than a fixed number, and then > decide to stop tailing the messages by some kind of keystroke; CTRL-C > -ish. Currently, a CTRL-C/SIGINT will kill the entire Stellar REPL instead > of just the currently running function. > > > -- > Nick Allen <[email protected]> >
