summaryrefslogtreecommitdiff
path: root/sql/pgq_coop/structure/functions.sql
blob: 7297ea653d63e9f5fa52d4eef2883718af24f236 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36

-- ----------------------------------------------------------------------
-- Section: Functions
--
-- Overview:
-- 
-- The usual flow of a cooperative consumer is to
-- 
--  1. register itself as a subconsumer for a queue:
--      pgq_coop.register_subconsumer() 
-- 
-- And the run a loop doing
--
--  2A. pgq_coop.next_batch ()
--
--  2B. pgq_coop.finish_batch()
-- 
-- Once the cooperative (or sub-)consuber is done, it should unregister 
-- itself before exiting
-- 
--  3. pgq_coop.unregister_subconsumer() 
-- 
-- 
-- ----------------------------------------------------------------------

-- Group: Subconsumer registration
\i functions/pgq_coop.register_subconsumer.sql
\i functions/pgq_coop.unregister_subconsumer.sql

-- Group: Event processing
\i functions/pgq_coop.next_batch.sql
\i functions/pgq_coop.finish_batch.sql

-- Group: General Info
\i functions/pgq_coop.version.sql