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
Reactions are currently unavailable
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
Describe alternatives you've considered
It would be great to have:
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