The residue theorem is a standard result in complex analysis, I state it below so we are on the same page: note that $\overline{\mathbb{C}}$ is the extended complex plane (ie. $\simeq$ Riemann sphere)
Let $f : \overline{\mathbb{C}} \rightarrow \overline{\mathbb{C}}$ be a function which is analytic inside a positively-oriented closed contour $C \subset \overline{\mathbb{C}}$ apart from at a finite number of singular points $a_{1}, \ldots a_{n}$ which are contained inside $C$. Then we have the following result known as the residue theorem, \begin{eqnarray} \int_{C} f(z) \ dz = 2 \pi i \sum_{\nu = 1}^{n} \text{Res}_{z=a_{\nu}}f(z). \quad \quad \quad \quad \quad (1)\end{eqnarray}
My question is: what if $n = \infty$?
There must be extra conditions in this case because, while the left hand side of (1) may converge, the right hand side of (1) becomes a series and may not converge.
A thought: if $\sum_{\nu=1}^{\infty} \text{Res}_{z=a_{\nu}}f(z)$ is only a formal series, then perhaps it represents $\frac{1}{2\pi i}\int_{C}f(z) \ dz$ asymptotically. ie. $\frac{1}{2\pi i}\int_{C}f(z) \ dz \sim \sum_{\nu=1}^{n} \text{Res}_{z=a_{\nu}}f(z)$ as $n \rightarrow \infty$, is this the answer?