Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use lists by default like msgspec, update to latest msgspec and msgpack releases #300

Merged
merged 9 commits into from
Feb 15, 2022
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
extras_require={

# serialization
'msgspec': ["msgspec >= 0.3.2'; python_version >= '3.9'"],
'msgspec': ['msgspec >= "0.4.0"'],

},
tests_require=['pytest'],
Expand Down
8 changes: 4 additions & 4 deletions tractor/_ipc.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,8 @@ def raddr(self) -> Tuple[str, int]:


class MsgpackTCPStream:
'''A ``trio.SocketStream`` delivering ``msgpack`` formatted data
'''
A ``trio.SocketStream`` delivering ``msgpack`` formatted data
using ``msgpack-python``.

'''
Expand Down Expand Up @@ -124,7 +125,6 @@ async def _iter_packets(self) -> AsyncGenerator[dict, None]:
"""
unpacker = msgpack.Unpacker(
raw=False,
use_list=False,
strict_map_key=False
)
while True:
Expand Down Expand Up @@ -222,8 +222,8 @@ def __init__(
self.prefix_size = prefix_size

# TODO: struct aware messaging coders
self.encode = msgspec.Encoder().encode
self.decode = msgspec.Decoder().decode # dict[str, Any])
self.encode = msgspec.msgpack.Encoder().encode
self.decode = msgspec.msgpack.Decoder().decode # dict[str, Any])

async def _iter_packets(self) -> AsyncGenerator[dict, None]:
'''Yield packets from the underlying stream.
Expand Down