Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 135751e

Browse files
committed
Merged revisions 80633 via svnmerge from
svn+ssh://[email protected]/python/branches/py3k ................ r80633 | giampaolo.rodola | 2010-04-29 22:45:01 +0200 (gio, 29 apr 2010) | 9 lines Merged revisions 80631 via svnmerge from svn+ssh://[email protected]/python/trunk ........ r80631 | giampaolo.rodola | 2010-04-29 22:31:17 +0200 (gio, 29 apr 2010) | 1 line Fixes issue 8543 (asynchat documentation issues) ........ ................
1 parent cbfee1d commit 135751e

1 file changed

Lines changed: 10 additions & 91 deletions

File tree

Doc/library/asynchat.rst

Lines changed: 10 additions & 91 deletions
Original file line numberDiff line numberDiff line change
@@ -80,12 +80,6 @@ connection requests.
8080
:exc:`NotImplementedError` exception.
8181

8282

83-
.. method:: async_chat._collect_incoming_data(data)
84-
85-
Sample implementation of a data collection rutine to be used in conjunction
86-
with :meth:`_get_data` in a user-specified :meth:`found_terminator`.
87-
88-
8983
.. method:: async_chat.discard_buffers()
9084

9185
In emergencies this method will discard any data held in the input and/or
@@ -100,49 +94,17 @@ connection requests.
10094
should be available via an instance attribute.
10195

10296

103-
.. method:: async_chat._get_data()
104-
105-
Will return and clear the data received with the sample
106-
:meth:`_collect_incoming_data` implementation.
107-
108-
10997
.. method:: async_chat.get_terminator()
11098

11199
Returns the current terminator for the channel.
112100

113101

114-
.. method:: async_chat.handle_close()
115-
116-
Called when the channel is closed. The default method silently closes the
117-
channel's socket.
118-
119-
120-
.. method:: async_chat.handle_read()
121-
122-
Called when a read event fires on the channel's socket in the asynchronous
123-
loop. The default method checks for the termination condition established
124-
by :meth:`set_terminator`, which can be either the appearance of a
125-
particular string in the input stream or the receipt of a particular number
126-
of characters. When the terminator is found, :meth:`handle_read` calls the
127-
:meth:`found_terminator` method after calling :meth:`collect_incoming_data`
128-
with any data preceding the terminating condition.
129-
130-
131-
.. method:: async_chat.handle_write()
132-
133-
Called when the application may write data to the channel. The default
134-
method calls the :meth:`initiate_send` method, which in turn will call
135-
:meth:`refill_buffer` to collect data from the producer fifo associated
136-
with the channel.
137-
138-
139102
.. method:: async_chat.push(data)
140103

141-
Creates a :class:`simple_producer` object (*see below*) containing the data
142-
and pushes it on to the channel's ``producer_fifo`` to ensure its
143-
transmission. This is all you need to do to have the channel write the
144-
data out to the network, although it is possible to use your own producers
145-
in more complex schemes to implement encryption and chunking, for example.
104+
Pushes data on to the channel's fifo to ensure its transmission.
105+
This is all you need to do to have the channel write the data out to the
106+
network, although it is possible to use your own producers in more complex
107+
schemes to implement encryption and chunking, for example.
146108

147109

148110
.. method:: async_chat.push_with_producer(producer)
@@ -153,20 +115,6 @@ connection requests.
153115
method and send the data to the remote endpoint.
154116

155117

156-
.. method:: async_chat.readable()
157-
158-
Should return ``True`` for the channel to be included in the set of
159-
channels tested by the :cfunc:`select` loop for readability.
160-
161-
162-
.. method:: async_chat.refill_buffer()
163-
164-
Refills the output buffer by calling the :meth:`more` method of the
165-
producer at the head of the fifo. If it is exhausted then the producer is
166-
popped off the fifo and the next producer is activated. If the current
167-
producer is, or becomes, ``None`` then the channel is closed.
168-
169-
170118
.. method:: async_chat.set_terminator(term)
171119

172120
Sets the terminating condition to be recognized on the channel. ``term``
@@ -191,36 +139,16 @@ connection requests.
191139
by the channel after :meth:`found_terminator` is called.
192140

193141

194-
.. method:: async_chat.writable()
195-
196-
Should return ``True`` as long as items remain on the producer fifo, or the
197-
channel is connected and the channel's output buffer is non-empty.
198-
199-
200-
asynchat - Auxiliary Classes and Functions
142+
asynchat - Auxiliary Classes
201143
------------------------------------------
202144

203-
204-
.. class:: simple_producer(data, buffer_size=512)
205-
206-
A :class:`simple_producer` takes a chunk of data and an optional buffer
207-
size. Repeated calls to its :meth:`more` method yield successive chunks of
208-
the data no larger than *buffer_size*.
209-
210-
211-
.. method:: more()
212-
213-
Produces the next chunk of information from the producer, or returns the
214-
empty string.
215-
216-
217145
.. class:: fifo(list=None)
218146

219-
Each channel maintains a :class:`fifo` holding data which has been pushed
220-
by the application but not yet popped for writing to the channel. A
221-
:class:`fifo` is a list used to hold data and/or producers until they are
222-
required. If the *list* argument is provided then it should contain
223-
producers or data items to be written to the channel.
147+
A :class:`fifo` holding data which has been pushed by the application but
148+
not yet popped for writing to the channel. A :class:`fifo` is a list used
149+
to hold data and/or producers until they are required. If the *list*
150+
argument is provided then it should contain producers or data items to be
151+
written to the channel.
224152

225153

226154
.. method:: is_empty()
@@ -244,15 +172,6 @@ asynchat - Auxiliary Classes and Functions
244172
If the fifo is not empty, returns ``True, first()``, deleting the popped
245173
item. Returns ``False, None`` for an empty fifo.
246174

247-
The :mod:`asynchat` module also defines one utility function, which may be of
248-
use in network and textual analysis operations.
249-
250-
251-
.. function:: find_prefix_at_end(haystack, needle)
252-
253-
Returns ``True`` if string *haystack* ends with any non-empty prefix of
254-
string *needle*.
255-
256175

257176
.. _asynchat-example:
258177

0 commit comments

Comments
 (0)