1/*-------------------------------------------------------------------------
4 * Parallel support for bin/scripts/
6 * Copyright (c) 2003-2025, PostgreSQL Global Development Group
8 * src/include/fe_utils/parallel_slot.h
10 *-------------------------------------------------------------------------
12#ifndef PARALLEL_SLOT_H
13#define PARALLEL_SLOT_H
24 bool inUse;
/* Is the slot being used? */
27 * Prior to issuing a command or query on 'connection', a handler callback
28 * function may optionally be registered to be invoked to process the
29 * results, and context information may optionally be registered for use
30 * by the handler. If unset, these fields should be NULL.
77#endif /* PARALLEL_SLOT_H */
#define FLEXIBLE_ARRAY_MEMBER
ParallelSlotArray * ParallelSlotsSetup(int numslots, ConnParams *cparams, const char *progname, bool echo, const char *initcmd)
bool ParallelSlotsWaitCompletion(ParallelSlotArray *sa)
bool(* ParallelSlotResultHandler)(PGresult *res, PGconn *conn, void *context)
bool TableCommandResultHandler(PGresult *res, PGconn *conn, void *context)
struct ParallelSlotArray ParallelSlotArray
static void ParallelSlotSetHandler(ParallelSlot *slot, ParallelSlotResultHandler handler, void *context)
ParallelSlot * ParallelSlotsGetIdle(ParallelSlotArray *sa, const char *dbname)
static void ParallelSlotClearHandler(ParallelSlot *slot)
void ParallelSlotsTerminate(ParallelSlotArray *sa)
void ParallelSlotsAdoptConn(ParallelSlotArray *sa, PGconn *conn)
struct ParallelSlot ParallelSlot
ParallelSlot slots[FLEXIBLE_ARRAY_MEMBER]
ParallelSlotResultHandler handler