Is your feature request related to a problem?
Currently, many asynchronous Python projects are moving away from Pydantic in favor of msgspec due to its superior performance in serialization and validation. While taskiq is flexible, the documentation and default examples heavily lean towards Pydantic.
I would like to clarify the current state of msgspec support and suggest making it a first-class citizen in the taskiq ecosystem.
Describe the solution you'd like
- Compatibility: Are there any known architectural constraints that prevent using
msgspec.Struct for task arguments and result schemas instead of Pydantic models?
- Encoders: Is there a recommended way to implement a custom
TaskiqEncoder using msgspec to ensure minimal overhead during task serialization?
- Validation: Does the library plan to provide a built-in
MsgspecBroker or similar integration to bypass Pydantic's validation logic entirely?
Describe alternatives you've considered
It would be great to have:
- An official
taskiq-msgspec package or a dedicated encoder implementation.
- Documentation/examples showing how to define tasks using
msgspec.Struct without triggering Pydantic-based validation under the hood.
- Benchmarks or a "performance-first" guide for users who prioritize speed and low memory footprint.
Additional context
For high-load backend systems, reducing the serialization overhead is critical. msgspec is often 10-80x faster than Pydantic, and having it as a seamless alternative would make taskiq the go-to choice for performance-critical distributed tasks.
Which component would this affect?
Other
Is your feature request related to a problem?
Currently, many asynchronous Python projects are moving away from Pydantic in favor of
msgspecdue to its superior performance in serialization and validation. Whiletaskiqis flexible, the documentation and default examples heavily lean towards Pydantic.I would like to clarify the current state of
msgspecsupport and suggest making it a first-class citizen in thetaskiqecosystem.Describe the solution you'd like
msgspec.Structfor task arguments and result schemas instead of Pydantic models?TaskiqEncoderusingmsgspecto ensure minimal overhead during task serialization?MsgspecBrokeror similar integration to bypass Pydantic's validation logic entirely?Describe alternatives you've considered
It would be great to have:
taskiq-msgspecpackage or a dedicated encoder implementation.msgspec.Structwithout triggering Pydantic-based validation under the hood.Additional context
For high-load backend systems, reducing the serialization overhead is critical.
msgspecis often 10-80x faster than Pydantic, and having it as a seamless alternative would maketaskiqthe go-to choice for performance-critical distributed tasks.Which component would this affect?
Other