blob: 92f7aad6dc07c0fb7c46aa5c06429d2056c403b4 [file]
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"DTD/xhtml1-strict.dtd">
<html>
<head>
<title>pulsar.Reader</title>
<meta name="generator" content="pydoctor 25.4.0">
</meta>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1 maximum-scale=1" />
<link rel="stylesheet" type="text/css" href="apidocs.css" />
<link rel="stylesheet" type="text/css" href="readthedocstheme.css" />
<link rel="stylesheet" type="text/css" href="extra.css" />
</head>
<body>
<nav class="navbar navbar-default mainnavbar">
<div class="container-fluid">
<div class="navbar-header">
<div class="navlinks">
<span class="navbar-brand">
_pulsar/pulsar <a href="index.html">API Documentation</a>
</span>
<a href="moduleIndex.html">
Modules
</a>
<a href="classIndex.html">
Classes
</a>
<a href="nameIndex.html">
Names
</a>
<div id="search-box-container">
<div class="input-group">
<input id="search-box" type="search" name="search-query" placeholder="Search..." aria-label="Search" minlength="2" class="form-control" autocomplete="off" />
<span class="input-group-btn">
<a style="display: none;" class="btn btn-default" id="search-clear-button" title="Clear" onclick="clearSearch()"><img src="fonts/x-circle.svg" alt="Clear" /></a>
<a class="btn btn-default" id="apidocs-help-button" title="Help" href="apidocs-help.html"><img src="fonts/info.svg" alt="Help" /></a>
</span>
</div>
</div>
</div>
<div id="search-results-container" style="display: none;">
<div id="search-buttons">
<span class="label label-default" id="search-docstrings-button">
<label class="checkbox-inline">
<input type="checkbox" id="toggle-search-in-docstrings-checkbox" value="false" onclick="toggleSearchInDocstrings()">
search in docstrings
</input>
</label>
</span>
</div>
<noscript>
<h1>Cannot search: JavaScript is not supported/enabled in your browser.</h1>
</noscript>
<div id="search-status"> </div>
<div class="warning" id="search-warn-box" style="display: none;">
<p class="rst-last"><span id="search-warn"></span></p>
</div>
<table id="search-results">
<!-- Filled dynamically by JS -->
</table>
<div style="margin-top: 10px;">
<p>For more information on the search, visit the <a href="apidocs-help.html#rst-search">help page</a>.</p>
</div>
</div>
</div>
</div>
<!-- Side navigation -->
<div class="sidebarcontainer">
<nav class="sidebar">
<div>
<div class="thingTitle">
<span>Class</span>
<code class="thisobject"><a href="pulsar.Reader.html" class="internal-link" title="This class"><wbr></wbr>Reader</a></code>
</div>
<div>
<div class="childrenKindTitle">Methods</div>
<ul>
<li class="">
<div class="itemName"><code><a href="#close" class="internal-link" title="pulsar.Reader.close">close</a></code>
</div>
</li><li class="">
<div class="itemName"><code><a href="#has_message_available" class="internal-link" title="pulsar.Reader.has_message_available">has<wbr></wbr>_message<wbr></wbr>_available</a></code>
</div>
</li><li class="">
<div class="itemName"><code><a href="#is_connected" class="internal-link" title="pulsar.Reader.is_connected">is<wbr></wbr>_connected</a></code>
</div>
</li><li class="">
<div class="itemName"><code><a href="#read_next" class="internal-link" title="pulsar.Reader.read_next">read<wbr></wbr>_next</a></code>
</div>
</li><li class="">
<div class="itemName"><code><a href="#seek" class="internal-link" title="pulsar.Reader.seek">seek</a></code>
</div>
</li><li class="">
<div class="itemName"><code><a href="#topic" class="internal-link" title="pulsar.Reader.topic">topic</a></code>
</div>
</li>
</ul>
</div>
</div><div>
<div class="thingTitle">
<span>Package</span>
<code><a href="pulsar.html" class="internal-link" title="The parent of this class">pulsar</a></code>
</div>
<div>
<div class="childrenKindTitle">Modules</div>
<ul>
<li class="">
<div class="itemName"><code><a href="pulsar.__about__.html" class="internal-link" title="pulsar.__about__">__about__</a></code>
</div>
</li><li class="">
<div class="itemName"><code><a href="pulsar.asyncio.html" class="internal-link" title="pulsar.asyncio">asyncio</a></code>
</div>
</li><li class="">
<div class="itemName"><code><a href="pulsar.exceptions.html" class="internal-link" title="pulsar.exceptions">exceptions</a></code>
</div>
</li><li class="">
<div class="itemName"><code><a href="pulsar.functions.html" class="internal-link" title="pulsar.functions">functions</a></code>
</div>
</li><li class="">
<div class="itemName"><code><a href="pulsar.schema.html" class="internal-link" title="pulsar.schema">schema</a></code>
</div>
</li><li class="">
<div class="itemName"><code><a href="pulsar.tableview.html" class="internal-link" title="pulsar.tableview">tableview</a></code>
</div>
</li>
</ul>
<div class="childrenKindTitle">Classes</div>
<ul>
<li class="">
<div class="itemName"><code><a href="pulsar.Authentication.html" class="internal-link" title="pulsar.Authentication"><wbr></wbr>Authentication</a></code>
</div>
</li><li class="">
<div class="itemName"><code><a href="pulsar.AuthenticationAthenz.html" class="internal-link" title="pulsar.AuthenticationAthenz"><wbr></wbr>Authentication<wbr></wbr>Athenz</a></code>
</div>
</li><li class="">
<div class="itemName"><code><a href="pulsar.AuthenticationBasic.html" class="internal-link" title="pulsar.AuthenticationBasic"><wbr></wbr>Authentication<wbr></wbr>Basic</a></code>
</div>
</li><li class="">
<div class="itemName"><code><a href="pulsar.AuthenticationOauth2.html" class="internal-link" title="pulsar.AuthenticationOauth2"><wbr></wbr>Authentication<wbr></wbr>Oauth2</a></code>
</div>
</li><li class="">
<div class="itemName"><code><a href="pulsar.AuthenticationTLS.html" class="internal-link" title="pulsar.AuthenticationTLS"><wbr></wbr>Authentication<wbr></wbr>TLS</a></code>
</div>
</li><li class="">
<div class="itemName"><code><a href="pulsar.AuthenticationToken.html" class="internal-link" title="pulsar.AuthenticationToken"><wbr></wbr>Authentication<wbr></wbr>Token</a></code>
</div>
</li><li class="">
<div class="itemName"><code><a href="pulsar.AutoClusterFailover.html" class="internal-link" title="pulsar.AutoClusterFailover"><wbr></wbr>Auto<wbr></wbr>Cluster<wbr></wbr>Failover</a></code>
</div>
</li><li class="">
<div class="itemName"><code><a href="pulsar.Client.html" class="internal-link" title="pulsar.Client"><wbr></wbr>Client</a></code>
</div>
</li><li class="">
<div class="itemName"><code><a href="pulsar.ConsoleLogger.html" class="internal-link" title="pulsar.ConsoleLogger"><wbr></wbr>Console<wbr></wbr>Logger</a></code>
</div>
</li><li class="">
<div class="itemName"><code><a href="pulsar.Consumer.html" class="internal-link" title="pulsar.Consumer"><wbr></wbr>Consumer</a></code>
</div>
</li><li class="">
<div class="itemName"><code><a href="pulsar.ConsumerBatchReceivePolicy.html" class="internal-link" title="pulsar.ConsumerBatchReceivePolicy"><wbr></wbr>Consumer<wbr></wbr>Batch<wbr></wbr>Receive<wbr></wbr>Policy</a></code>
</div>
</li><li class="">
<div class="itemName"><code><a href="pulsar.ConsumerDeadLetterPolicy.html" class="internal-link" title="pulsar.ConsumerDeadLetterPolicy"><wbr></wbr>Consumer<wbr></wbr>Dead<wbr></wbr>Letter<wbr></wbr>Policy</a></code>
</div>
</li><li class="">
<div class="itemName"><code><a href="pulsar.ConsumerKeySharedPolicy.html" class="internal-link" title="pulsar.ConsumerKeySharedPolicy"><wbr></wbr>Consumer<wbr></wbr>Key<wbr></wbr>Shared<wbr></wbr>Policy</a></code>
</div>
</li><li class="">
<div class="itemName"><code><a href="pulsar.CryptoKeyReader.html" class="internal-link" title="pulsar.CryptoKeyReader"><wbr></wbr>Crypto<wbr></wbr>Key<wbr></wbr>Reader</a></code>
</div>
</li><li class="">
<div class="itemName"><code><a href="pulsar.EncryptionContext.html" class="internal-link" title="pulsar.EncryptionContext"><wbr></wbr>Encryption<wbr></wbr>Context</a></code>
</div>
</li><li class="">
<div class="itemName"><code><a href="pulsar.EncryptionKey.html" class="internal-link" title="pulsar.EncryptionKey"><wbr></wbr>Encryption<wbr></wbr>Key</a></code>
</div>
</li><li class="">
<div class="itemName"><code><a href="pulsar.FileLogger.html" class="internal-link" title="pulsar.FileLogger"><wbr></wbr>File<wbr></wbr>Logger</a></code>
</div>
</li><li class="">
<div class="itemName"><code><a href="pulsar.Message.html" class="internal-link" title="pulsar.Message"><wbr></wbr>Message</a></code>
</div>
</li><li class="">
<div class="itemName"><code><a href="pulsar.MessageBatch.html" class="internal-link" title="pulsar.MessageBatch"><wbr></wbr>Message<wbr></wbr>Batch</a></code>
</div>
</li><li class="">
<div class="itemName"><code><a href="pulsar.MessageId.html" class="internal-link" title="pulsar.MessageId"><wbr></wbr>Message<wbr></wbr>Id</a></code>
</div>
</li><li class="">
<div class="itemName"><code><a href="pulsar.Producer.html" class="internal-link" title="pulsar.Producer"><wbr></wbr>Producer</a></code>
</div>
</li><li class=" thisobject">
<div class="itemName"><code><a href="pulsar.Reader.html" class="internal-link" title="pulsar.Reader"><wbr></wbr>Reader</a></code>
</div>
</li><li class="">
<div class="itemName"><code><a href="pulsar.ServiceInfo.html" class="internal-link" title="pulsar.ServiceInfo"><wbr></wbr>Service<wbr></wbr>Info</a></code>
</div>
</li><li class="">
<div class="itemName"><code><a href="pulsar.ServiceInfoProvider.html" class="internal-link" title="pulsar.ServiceInfoProvider"><wbr></wbr>Service<wbr></wbr>Info<wbr></wbr>Provider</a></code>
</div>
</li>
</ul>
<div class="childrenKindTitle">Functions</div>
<ul>
<li class="private">
<div class="itemName"><code><a href="pulsar.html#_check_type" class="internal-link" title="pulsar._check_type">_check<wbr></wbr>_type</a></code>
</div>
</li><li class="private">
<div class="itemName"><code><a href="pulsar.html#_check_type_or_none" class="internal-link" title="pulsar._check_type_or_none">_check<wbr></wbr>_type<wbr></wbr>_or<wbr></wbr>_none</a></code>
</div>
</li><li class="private">
<div class="itemName"><code><a href="pulsar.html#_listener_wrapper" class="internal-link" title="pulsar._listener_wrapper">_listener<wbr></wbr>_wrapper</a></code>
</div>
</li><li class="private">
<div class="itemName"><code><a href="pulsar.html#_seek_arg_convert" class="internal-link" title="pulsar._seek_arg_convert">_seek<wbr></wbr>_arg<wbr></wbr>_convert</a></code>
</div>
</li>
</ul>
<div class="childrenKindTitle">Variables</div>
<ul>
<li class="private">
<div class="itemName"><code><a href="pulsar.html#_retype" class="internal-link" title="pulsar._retype">_retype</a></code>
</div>
</li>
</ul>
</div>
</div>
</nav>
<!-- No sidebar toggle for read the docs theme, the sidebar is always
visible when the screen is width enough.
-->
</div>
</nav>
<div class="container-fluid">
<div id="main" class="">
<div class="page-header">
<h1 class="class"><code><code><a href="pulsar.html" class="internal-link">pulsar</a></code><wbr></wbr>.<code><a href="pulsar.Reader.html" class="internal-link" title="pulsar.Reader">Reader</a></code></code></h1>
<div id="showPrivate">
<button class="btn btn-link" onclick="togglePrivate()">Toggle Private API</button>
</div>
</div>
<div class="categoryHeader">
class documentation
</div>
<div class="extrasDocstring">
<p class="class-signature"><code><span class="py-keyword">class</span> <span class="py-defname">Reader</span>: <a href="https://github.com/apache/pulsar-client-python/tree/v3.11.0/pulsar/__init__.py#L2186" class="sourceLink">(source)</a></code></p>
<p><a href="classIndex.html#pulsar.Reader">View In Hierarchy</a></p>
</div>
<div class="moduleDocstring">
<div><p>Pulsar topic reader.</p></div>
</div>
<div id="splitTables">
<table class="children sortable" id="id80">
<tr class="method">
<td>Method</td>
<td><code><a href="#close" class="internal-link" title="pulsar.Reader.close">close</a></code></td>
<td>Close the reader.</td>
</tr><tr class="method">
<td>Method</td>
<td><code><a href="#has_message_available" class="internal-link" title="pulsar.Reader.has_message_available">has<wbr></wbr>_message<wbr></wbr>_available</a></code></td>
<td>Check if there is any message available to read from the current position.</td>
</tr><tr class="method">
<td>Method</td>
<td><code><a href="#is_connected" class="internal-link" title="pulsar.Reader.is_connected">is<wbr></wbr>_connected</a></code></td>
<td>Check if the reader is connected or not.</td>
</tr><tr class="method">
<td>Method</td>
<td><code><a href="#read_next" class="internal-link" title="pulsar.Reader.read_next">read<wbr></wbr>_next</a></code></td>
<td>Read a single message.</td>
</tr><tr class="method">
<td>Method</td>
<td><code><a href="#seek" class="internal-link" title="pulsar.Reader.seek">seek</a></code></td>
<td>Reset this reader to a specific message id or publish timestamp. The message id can either be a specific message or represent the first or last messages in the topic. Note: this operation can only be done on non-partitioned topics...</td>
</tr><tr class="method">
<td>Method</td>
<td><code><a href="#topic" class="internal-link" title="pulsar.Reader.topic">topic</a></code></td>
<td>Return the topic this reader is reading from.</td>
</tr>
</table>
</div>
<div id="childList">
<div class="basemethod">
<a name="pulsar.Reader.close">
</a>
<a name="close">
</a>
<div class="functionHeader">
<span class="py-keyword">def</span>&#160;<span class="py-defname">close</span><span class="function-signature">(<span class="rst-sig-param"><span class="rst-undocumented">self</span></span>):</span>
<a class="sourceLink" href="https://github.com/apache/pulsar-client-python/tree/v3.11.0/pulsar/__init__.py#L2242">
(source)
</a>
<a class="headerLink" href="#close" title="pulsar.Reader.close">
</a>
</div>
<div class="docstring functionBody">
<div><p>Close the reader.</p></div>
</div>
</div><div class="basemethod">
<a name="pulsar.Reader.has_message_available">
</a>
<a name="has_message_available">
</a>
<div class="functionHeader">
<span class="py-keyword">def</span>&#160;<span class="py-defname">has_message_available</span><span class="function-signature">(<span class="rst-sig-param"><span class="rst-undocumented">self</span></span>):</span>
<a class="sourceLink" href="https://github.com/apache/pulsar-client-python/tree/v3.11.0/pulsar/__init__.py#L2221">
(source)
</a>
<a class="headerLink" href="#has_message_available" title="pulsar.Reader.has_message_available">
</a>
</div>
<div class="docstring functionBody">
<div><p>Check if there is any message available to read from the current position.</p></div>
</div>
</div><div class="basemethod">
<a name="pulsar.Reader.is_connected">
</a>
<a name="is_connected">
</a>
<div class="functionHeader">
<span class="py-keyword">def</span>&#160;<span class="py-defname">is_connected</span><span class="function-signature">(<span class="rst-sig-param"><span class="rst-undocumented">self</span></span>):</span>
<a class="sourceLink" href="https://github.com/apache/pulsar-client-python/tree/v3.11.0/pulsar/__init__.py#L2249">
(source)
</a>
<a class="headerLink" href="#is_connected" title="pulsar.Reader.is_connected">
</a>
</div>
<div class="docstring functionBody">
<div><p>Check if the reader is connected or not.</p></div>
</div>
</div><div class="basemethod">
<a name="pulsar.Reader.read_next">
</a>
<a name="read_next">
</a>
<div class="functionHeader">
<span class="py-keyword">def</span>&#160;<span class="py-defname">read_next</span><span class="function-signature">(<span class="rst-sig-param"><span class="rst-undocumented">self</span>, </span><span class="rst-sig-param">timeout_millis=<a href="https://docs.python.org/3/library/constants.html#None" class="intersphinx-link">None</a></span>):</span>
<a class="sourceLink" href="https://github.com/apache/pulsar-client-python/tree/v3.11.0/pulsar/__init__.py#L2197">
(source)
</a>
<a class="headerLink" href="#read_next" title="pulsar.Reader.read_next">
</a>
</div>
<div class="docstring functionBody">
<div><p>Read a single message.</p>
<p>If a message is not immediately available, this method will block until
a new message is available.</p>
<table class="fieldTable"><tr class="fieldStart"><td class="fieldName" colspan="2">Parameters</td></tr><tr><td class="fieldArgContainer"><span class="fieldArg">timeout<wbr></wbr>_millis:</span><code><a href="https://docs.python.org/3/library/functions.html#int" class="intersphinx-link">int</a></code>, <em>optional</em></td><td class="fieldArgDesc">If specified, the receiver will raise an exception if a message is not available within the timeout.</td></tr></table></div>
</div>
</div><div class="basemethod">
<a name="pulsar.Reader.seek">
</a>
<a name="seek">
</a>
<div class="functionHeader">
<span class="py-keyword">def</span>&#160;<span class="py-defname">seek</span><span class="function-signature">(<span class="rst-sig-param"><span class="rst-undocumented">self</span>, </span><span class="rst-sig-param">messageid: <code><a href="pulsar.MessageId.html" class="internal-link" title="pulsar.MessageId">MessageId</a> | <a href="_pulsar.MessageId.html" class="internal-link" title="_pulsar.MessageId">_pulsar.MessageId</a> | <a href="https://docs.python.org/3/library/functions.html#int" class="intersphinx-link">int</a></code></span>):</span>
<a class="sourceLink" href="https://github.com/apache/pulsar-client-python/tree/v3.11.0/pulsar/__init__.py#L2227">
(source)
</a>
<a class="headerLink" href="#seek" title="pulsar.Reader.seek">
</a>
</div>
<div class="docstring functionBody">
<div><p>Reset this reader to a specific message id or publish timestamp.
The message id can either be a specific message or represent the first or last messages in the topic.
Note: this operation can only be done on non-partitioned topics. For these, one can rather perform the
seek() on the individual partitions.</p><table class="fieldTable"><tr class="fieldStart"><td class="fieldName" colspan="2">Parameters</td></tr><tr><td class="fieldArgContainer"><span class="fieldArg">messageid:</span><code><a href="pulsar.MessageId.html" class="internal-link" title="pulsar.MessageId">MessageId</a></code>, <code><a href="_pulsar.MessageId.html" class="internal-link">_pulsar.MessageId</a></code> or <code><a href="https://docs.python.org/3/library/functions.html#int" class="intersphinx-link">int</a></code></td><td class="fieldArgDesc">The message id for seek, OR an integer event time to seek to</td></tr></table></div>
</div>
</div><div class="basemethod">
<a name="pulsar.Reader.topic">
</a>
<a name="topic">
</a>
<div class="functionHeader">
<span class="py-keyword">def</span>&#160;<span class="py-defname">topic</span><span class="function-signature">(<span class="rst-sig-param"><span class="rst-undocumented">self</span></span>):</span>
<a class="sourceLink" href="https://github.com/apache/pulsar-client-python/tree/v3.11.0/pulsar/__init__.py#L2191">
(source)
</a>
<a class="headerLink" href="#topic" title="pulsar.Reader.topic">
</a>
</div>
<div class="docstring functionBody">
<div><p>Return the topic this reader is reading from.</p></div>
</div>
</div>
</div>
</div>
</div>
<footer class="navbar navbar-default">
<hr />
<div class="container-fluid">
<a href="index.html">API Documentation</a> for _pulsar/pulsar,
generated by <a href="https://github.com/twisted/pydoctor/">pydoctor</a>
25.4.0 at 2026-04-16 16:39:30.
</div>
<script src="ajax.js" type="text/javascript"></script>
<script src="searchlib.js" type="text/javascript"></script>
<script src="search.js" type="text/javascript"></script>
</footer>
<script src="pydoctor.js" type="text/javascript"></script>
</body>
</html>