From d18cf32e28421f0347a04292ac84ec4da6508722 Mon Sep 17 00:00:00 2001 From: Tyler Goodlet Date: Sun, 21 Apr 2024 17:02:39 -0400 Subject: [PATCH] Mark `.pld` msgs as also taking `msgspec.Raw` --- tractor/msg/types.py | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/tractor/msg/types.py b/tractor/msg/types.py index f7654f6..59ec2a4 100644 --- a/tractor/msg/types.py +++ b/tractor/msg/types.py @@ -38,6 +38,7 @@ from typing import ( from msgspec import ( defstruct, # field, + Raw, Struct, # UNSET, # UnsetType, @@ -105,7 +106,7 @@ class Msg( # TODO: could also be set to `msgspec.Raw` if the sub-decoders # approach is preferred over the generic parameterization # approach as take by `mk_msg_spec()` below. - pld: PayloadT + pld: PayloadT|Raw class Aid( @@ -332,7 +333,7 @@ class Started( decorated IPC endpoint. ''' - pld: PayloadT + pld: PayloadT|Raw # TODO: instead of using our existing `Start` @@ -349,7 +350,7 @@ class Yield( Per IPC transmission of a value from `await MsgStream.send()`. ''' - pld: PayloadT + pld: PayloadT|Raw class Stop( @@ -377,7 +378,7 @@ class Return( func-as-`trio.Task`. ''' - pld: PayloadT + pld: PayloadT|Raw class CancelAck( @@ -710,7 +711,9 @@ def mk_msg_spec( ) return ( ipc_spec, - msgtypes_table[spec_build_method] + ipc_msg_types, + msgtypes_table[spec_build_method] + + + ipc_msg_types, )