Comments (2)
Hi,
This looked like something I could take a stab at. I added the formats' crates and and modified the MessageBuilder impl to add a fn to set the desired serialization method, as well as updated Message::Body to match on the content-type of the message properties.
I wasn't sure if I should open a pull request or get some feedback here first. Let me know what you think.
Couple things:
-
I wasn't sure what tests to add, any input here?
-
I added feature flags for each format, but this might not be desired
-
I added an additional enum to the error types to encapsulate all the different format errors. Unfortunately the rust messagepack crate uses three separate error types, so there are more entries for that one than otherwise needed.
-
I duplicated a chunk of code from Message::body() for each type; I'd prefer to find a more succinct way to format this but the desired functions from each format aren't organized into a trait by serde so I can't use a generic function for it without adding a bunch of boilerplate. A macro would work but that would probably be pretty opaque.
from rusty-celery.
Hey @boylede, this looks really great! Thanks for taking this.
Please definitely open a PR with what you have. A couple thoughts so far:
- I think we should have tests that serialize and deserialize messages in various formats, checking that the original message is exactly the same as the deserialized one.
- I like the idea of putting these behind feature flags, but having one feature flag for each different format seems a little overkill. Maybe we could put all of the non-default formats (so everything except json) behind a single feature flag.
from rusty-celery.
Related Issues (20)
- rustls support
- Add task options that enable the user to send negative acknowledgements and rely on broker's retry mechanisms HOT 2
- Prefetch not working properly
- No connection was performed when setting `broker_connection_retry` to `false`
- How do I run the main method in beat_app.rs in a thread
- Cannot connect to broker with x-max-priority set HOT 2
- How to get TaskResult from AsyncResult? HOT 1
- New release? HOT 3
- Call for new features HOT 5
- BrokerBuilder is not Send HOT 6
- Socket was readable but we read 0. This usually means that the connection is half closed this mark it as broken HOT 7
- Celery task blocking main thread in actix web HOT 3
- does the RedisBroker support password
- WARN celery::broker::redis:Setting heartbeat on redis broker has no effect on anything HOT 2
- support streams protocol
- is it possible to define the log output level HOT 1
- Postgres as a broker/backend
- Limiting the rate of consuming HOT 4
- Delivery acknowledgement timeout on best practices
- Flower integration HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from rusty-celery.