File tree Expand file tree Collapse file tree 5 files changed +10
-7
lines changed Expand file tree Collapse file tree 5 files changed +10
-7
lines changed Original file line number Diff line number Diff line change @@ -49,8 +49,8 @@ let rec dump_res conn =
49
49
50
50
let rec dump_notification conn =
51
51
match conn#notifies with
52
- | Some (msg , pid ) ->
53
- printf " Notication from backend %i: [%s]\n " pid msg;
52
+ | Some (msg , pid , extra ) ->
53
+ printf " Notication from backend %i: [%s] [%s] \n " pid msg extra ;
54
54
flush stdout;
55
55
dump_notification conn
56
56
| None -> ()
Original file line number Diff line number Diff line change @@ -147,8 +147,8 @@ let main () =
147
147
148
148
let rec dump_notification () =
149
149
match conn#notifies with
150
- | Some (msg , pid ) ->
151
- let _ = clist#append [string_of_int pid; msg] in
150
+ | Some (msg , pid , extra ) ->
151
+ let _ = clist#append [string_of_int pid; msg; extra ] in
152
152
window#show () ;
153
153
dump_notification ()
154
154
| None -> () in
Original file line number Diff line number Diff line change @@ -452,7 +452,7 @@ module Stub = struct
452
452
453
453
(* Asynchronous Notification *)
454
454
455
- external notifies : connection -> (string * int ) option = " PQnotifies_stub"
455
+ external notifies : connection -> (string * int * string ) option = " PQnotifies_stub"
456
456
457
457
458
458
(* Functions Associated with the COPY Command *)
Original file line number Diff line number Diff line change @@ -468,7 +468,7 @@ object
468
468
469
469
(* * Asynchronous Notification *)
470
470
471
- method notifies : (string * int ) option
471
+ method notifies : (string * int * string ) option
472
472
(* * [#notifies] @return [Some (name, pid)] if available ([None]
473
473
otherwise), where [name] is the name the of relation containing
474
474
data, [pid] the process id of the backend.
Original file line number Diff line number Diff line change @@ -1006,14 +1006,17 @@ CAMLprim value PQnotifies_stub(value v_conn)
1006
1006
{
1007
1007
CAMLparam1 (v_conn );
1008
1008
CAMLlocal1 (v_str );
1009
+ CAMLlocal1 (v_extra );
1009
1010
PGnotify * noti = PQnotifies (get_conn (v_conn ));
1010
1011
1011
1012
if (noti ) {
1012
1013
value v_pair ;
1013
1014
v_str = make_string (noti -> relname );
1014
- v_pair = caml_alloc_small (2 , 0 );
1015
+ v_pair = caml_alloc_small (3 , 0 );
1016
+ v_extra = make_string (noti -> extra );
1015
1017
Field (v_pair , 0 ) = v_str ;
1016
1018
Field (v_pair , 1 ) = Val_int (noti -> be_pid );
1019
+ Field (v_pair , 2 ) = v_extra ;
1017
1020
PQfreemem (noti );
1018
1021
CAMLreturn (make_some (v_pair ));
1019
1022
}
You can’t perform that action at this time.
0 commit comments