DavidBM / rsmq-async-rs

RSMQ port to async rust. RSMQ is a simple redis queue system that works in any redis v2.6+
MIT License
43 stars 8 forks source link

Can't send/receive message of type other than String #8

Closed nicksrandall closed 3 years ago

nicksrandall commented 3 years ago

I'm new to rust for forgive me for any ignorance. I can't figure out how I could use this library to send any other kind of message besides a String. The docs mention that you could implement your on TryFrom trait on your type from RedisBytes but RedisBytes is a private type and therefore inaccessible to a user of the library.

I also tried to use plain Vec<u8> but I get an error saying expected enum "Infallible", found struct "Vec".

Maybe something has changed in rust since the library was implemented?

DavidBM commented 3 years ago

Hi, thanks for the heads up!!

Yes, you are right. There was a problem in the TryFrom implementation that made impossible for it to work. I remember it to be working in the past, so maybe it was a breaking edge case change in the TryFrom trait? In any case, I created this PR: https://github.com/Couragium/rsmq-async-rs/pull/9 It should be working there.

Once I get the PR I will merge it and publish the crate as the version 5.0.0. (The fix is a breaking change)

DavidBM commented 3 years ago

I have merged and published a new version of the crate. I have added tests for your case now, so you can use them as reference.

Thanks for reporting the issue @nicksrandall !!!