% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/wire.R
\name{drainConnection}
\alias{drainConnection}
\title{Drain RethinkDB connection}
\usage{
drainConnection(x)
}
\arguments{
\item{x}{Connection to drain.}
}
\description{
Drains a given RethinkDB connection, i.e. pull query responses and both call their associated callbacks (for async queries) and/or filling sync cursor local cache.
Draining ends when all async queries end; the function blocks for the entire time this is happening.
}
\details{
The async query callback will only fire during \code{drainConnection} or (opportunistically) \code{\link{cursorNext}}; consequently this function must be run to guarantee that installed callbacks will have a chance to fire.
}
