Skip to content

Commit 14a7048

Browse files
docstrings
1 parent c7b8729 commit 14a7048

File tree

3 files changed

+24
-2
lines changed

3 files changed

+24
-2
lines changed

docs/api.rst

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,3 +89,13 @@ API Reference
8989
.. autoclass:: AsyncAioPikaManager
9090
:members:
9191
:inherited-members:
92+
93+
.. autoclass:: socketio.packet.Packet
94+
:members:
95+
:inherited-members:
96+
:no-undoc-members:
97+
98+
.. autoclass:: socketio.msgpack_packet.MsgPackPacket
99+
:members:
100+
:inherited-members:
101+
:no-undoc-members:

src/socketio/msgpack_packet.py

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,22 @@
55
class MsgPackPacket(packet.Packet):
66
uses_binary_events = False
77
dumps_default = None
8-
ext_hook = msgpack.ExtType
8+
ext_hook = msgpack.ExtType #: :meta private:
99

1010
@classmethod
1111
def configure(cls, dumps_default=None, ext_hook=msgpack.ExtType):
12+
"""Change the default options for msgpack encoding and decoding.
13+
14+
:param dumps_default: a function called for objects that cannot be
15+
serialized by default msgpack. The function
16+
receives one argument, the object to serialize.
17+
It should return a serializable object or a
18+
``msgpack.ExtType`` instance.
19+
:param ext_hook: a function called when a ``msgpack.ExtType`` object is
20+
seen during decoding. The function receives two
21+
arguments, the code and the data. It should return the
22+
decoded object.
23+
"""
1224
class CustomMsgPackPacket(MsgPackPacket):
1325
dumps_default = None
1426
ext_hook = None

src/socketio/packet.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ class Packet:
2020
# data: JSON dump of data payload
2121

2222
uses_binary_events = True
23-
json = _json
23+
json = _json #: :meta private:
2424

2525
def __init__(self, packet_type=EVENT, data=None, namespace=None, id=None,
2626
binary=None, encoded_packet=None):

0 commit comments

Comments
 (0)