Mark `.pld` msgs as also taking `msgspec.Raw`

runtime_to_msgspec
Tyler Goodlet 2024-04-21 17:02:39 -04:00
parent dd6a4d49d8
commit d18cf32e28
1 changed files with 8 additions and 5 deletions

View File

@ -38,6 +38,7 @@ from typing import (
from msgspec import ( from msgspec import (
defstruct, defstruct,
# field, # field,
Raw,
Struct, Struct,
# UNSET, # UNSET,
# UnsetType, # UnsetType,
@ -105,7 +106,7 @@ class Msg(
# TODO: could also be set to `msgspec.Raw` if the sub-decoders # TODO: could also be set to `msgspec.Raw` if the sub-decoders
# approach is preferred over the generic parameterization # approach is preferred over the generic parameterization
# approach as take by `mk_msg_spec()` below. # approach as take by `mk_msg_spec()` below.
pld: PayloadT pld: PayloadT|Raw
class Aid( class Aid(
@ -332,7 +333,7 @@ class Started(
decorated IPC endpoint. decorated IPC endpoint.
''' '''
pld: PayloadT pld: PayloadT|Raw
# TODO: instead of using our existing `Start` # TODO: instead of using our existing `Start`
@ -349,7 +350,7 @@ class Yield(
Per IPC transmission of a value from `await MsgStream.send(<value>)`. Per IPC transmission of a value from `await MsgStream.send(<value>)`.
''' '''
pld: PayloadT pld: PayloadT|Raw
class Stop( class Stop(
@ -377,7 +378,7 @@ class Return(
func-as-`trio.Task`. func-as-`trio.Task`.
''' '''
pld: PayloadT pld: PayloadT|Raw
class CancelAck( class CancelAck(
@ -710,7 +711,9 @@ def mk_msg_spec(
) )
return ( return (
ipc_spec, ipc_spec,
msgtypes_table[spec_build_method] + ipc_msg_types, msgtypes_table[spec_build_method]
+
ipc_msg_types,
) )