mirror of https://github.com/jackc/pgx.git
parent
222e3b37bc
commit
f803c790d0
8
doc.go
8
doc.go
|
@ -161,12 +161,14 @@ notification is received or the context is canceled.
|
||||||
|
|
||||||
_, err := conn.Exec(context.Background(), "listen channelname")
|
_, err := conn.Exec(context.Background(), "listen channelname")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
if notification, err := conn.WaitForNotification(context.Background()); err != nil {
|
notification, err := conn.WaitForNotification(context.Background())
|
||||||
// do something with notification
|
if err != nil {
|
||||||
|
return err
|
||||||
}
|
}
|
||||||
|
// do something with notification
|
||||||
|
|
||||||
|
|
||||||
Tracing and Logging
|
Tracing and Logging
|
||||||
|
|
Loading…
Reference in New Issue