1 /*------------------------------------------------------------------------- 2 * 3 * tqueue.h 4 * Use shm_mq to send & receive tuples between parallel backends 5 * 6 * Portions Copyright (c) 1996-2018, PostgreSQL Global Development Group 7 * Portions Copyright (c) 1994, Regents of the University of California 8 * 9 * src/include/executor/tqueue.h 10 * 11 *------------------------------------------------------------------------- 12 */ 13 14 #ifndef TQUEUE_H 15 #define TQUEUE_H 16 17 #include "storage/shm_mq.h" 18 #include "tcop/dest.h" 19 20 /* Opaque struct, only known inside tqueue.c. */ 21 typedef struct TupleQueueReader TupleQueueReader; 22 23 /* Use this to send tuples to a shm_mq. */ 24 extern DestReceiver *CreateTupleQueueDestReceiver(shm_mq_handle *handle); 25 26 /* Use these to receive tuples from a shm_mq. */ 27 extern TupleQueueReader *CreateTupleQueueReader(shm_mq_handle *handle); 28 extern void DestroyTupleQueueReader(TupleQueueReader *reader); 29 extern HeapTuple TupleQueueReaderNext(TupleQueueReader *reader, 30 bool nowait, bool *done); 31 32 #endif /* TQUEUE_H */ 33