asyncpg icon indicating copy to clipboard operation
asyncpg copied to clipboard

cannot recieve notify from another connection.

Open slangmgh opened this issue 6 years ago • 1 comments

Notify can only recieve when sendNotify is send through the same connection with the notify.

proc testConnectionNotify(conn, conn2: apgConnection): Future[bool] {.async.} =
  var r1 = false
  var r2 = false
  await conn.listenNotify("testChannel")
  var notifyFuture1 = conn.notify("testChannel")
  await conn2.sendNotify("testChannel", "payload")
  #await conn.sendNotify("testChannel", "payload")
  var sleepFuture1 = sleepAsync(100)
  await notifyFuture1 or sleepFuture1
  if notifyFuture1.finished:
    echo notifyFuture1.read.payload
    r1 = true
    return true
  else:
    echo "failed"
    return false

slangmgh avatar Jun 17 '18 05:06 slangmgh

I'm encountering the same issue for now, is there any solution?

geohuz avatar Feb 23 '21 16:02 geohuz