From ggcoder
Invoke when code uses async/reactive patterns in GridGain/Ignite. Triggers: CompletableFuture, CompletionStage, Publisher, Subscriber, Flow, Channel, async callback, thenApply, whenComplete, exceptionally, backpressure. Invoke BEFORE fixing async code.
How this skill is triggered — by the user, by Claude, or both
Slash command
/ggcoder:async-patternsThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Key patterns from Continuous Query PRs #3565, #3588, #3592:
Key patterns from Continuous Query PRs #3565, #3588, #3592:
prev.thenCompose(tmp -> cursorFut)
.thenAcceptAsync(cursor -> {
process(cursor);
next.complete(result);
}, exec)
.exceptionally(t -> {
next.completeExceptionally(t);
return null;
});
Key: Use thenCompose (not thenApply) for future chaining
var channel = Channel.CreateBounded<T>(new BoundedChannelOptions(capacity) {
FullMode = BoundedChannelFullMode.Wait
});
// Producer with exception propagation
Task.Run(async () => {
try {
await foreach (var item in ScanPartition(partition)) {
await channel.Writer.WriteAsync(item);
}
} catch (Exception ex) {
channel.Writer.Complete(ex); // Propagate error!
}
});
public static final ClientProtocolFeature CQ_LONG_POLLING_WAIT_TIME =
new ClientProtocolFeature(42);
public void serialize(PayloadWriter writer, ProtocolVersion version) {
if (version.supports(CQ_LONG_POLLING_WAIT_TIME)) {
writer.writeLong(longPollingWaitTimeMs);
}
}
public CompletableFuture<Void> cancelAsync() {
if (!cancelled) {
synchronized (lock) {
if (!cancelled) {
pendingFuture.completeExceptionally(new CancelledException());
cancelled = true;
cancelFut.complete(null);
}
}
}
return cancelFut;
}
thenCompose for future chaining, not thenApplynpx claudepluginhub gridgain/ggcoderCreates structured, bite-sized implementation plans from specs or requirements before writing code. Useful for breaking down multi-step tasks into testable steps with file structure and task boundaries.