xs/backend_pg.xs

filter: Statementstmt 0.0% 0 / 10 Branchbran 0.0% 0 / 4 Conditioncond n/a MC/DCmcdc n/a Subroutinesub n/a Podpod n/a totaltotal 0.0% 0 / 14 CC 0 SCAR 0
CC
0
Cov
0%
CRAP 0
« include/pq_pg.h ↑ Summary xs/backend_sqlite.xs »
1 MODULE = Punk::Queue PACKAGE = Punk::Queue::Backend::Pg
2  
3 # The PostgreSQL divergences. Everything else this class answers to comes
4 # from Punk::Queue::Backend, which it inherits.
5  
6 SV *
7 dequeue(self, worker_id = 0, queues = NULL, tasks = NULL)
8 SV *self
9 IV worker_id
10 SV *queues
11 SV *tasks
12 PREINIT:
13 AV *q, *t;
14 SV *row;
15 CODE:
16 {
17 0 q = pq_sql_list(aTHX_ queues);
18 0 ▶ if (av_len(q) < 0) av_push(q, newSVpvs("default"));
Branch: 1 branch
BranchTrueFalseTotal
if (av_len(q) < 0) av_push(q, newSVpvs("default")); 0 0 0
19 0 t = pq_sql_list(aTHX_ tasks);
20  
21 0 row = pq_pg_dequeue(aTHX_ self, worker_id, q, t);
22 0 ▶ if (!row) XSRETURN_UNDEF;
Branch: 1 branch
BranchTrueFalseTotal
if (!row) XSRETURN_UNDEF; 0 0 0
23 0 RETVAL = row;
24 }
25 OUTPUT:
26 RETVAL
27  
28 # Emit a wakeup on a queue's channel. The LISTEN side is phase 5; this is
29 # what enqueue will call once it exists.
30 void
31 notify(self, queue, id)
32 SV *self
33 SV *queue
34 IV id
35 CODE:
36 0 pq_pg_notify(aTHX_ self, queue, id);
37  
38 # Transaction control, exposed so the conformance suite can drive it
39 # directly rather than only through the operations that use it.
40  
41 void
42 begin_immediate(self)
43 SV *self
44 CODE:
45 0 pq_pg_begin_exclusive(aTHX_ self);
46  
47 void
48 commit(self)
49 SV *self
50 CODE:
51 0 pq_pg_commit(aTHX_ self);
52  
53 void
54 rollback(self)
55 SV *self
56 CODE:
57 0 pq_pg_rollback(aTHX_ self);
« include/pq_pg.h ↑ Summary xs/backend_sqlite.xs »