-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Delayed message support for memory, rabbitmq, redis #19
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a hatchet job based on what you'll see in https://github.com/svix/svix-webhooks/blob/main/server/svix-server/src/queue/redis.rs
Could be useful to review the original while reading this module.
02f369d
to
a78dd7b
Compare
omniqueue/src/backends/redis/mod.rs
Outdated
// FIXME(onelson): original impl depends on chrono so it can convert to UTC. Should probably do this too. | ||
let timestamp: i64 = std::time::SystemTime::now() | ||
.duration_since(std::time::UNIX_EPOCH) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems like this is good as-is. I verified that SystemTime
gives UTC time, regardless of the TZ selection for the process.
Put another way, where running env TZ=America/New_York date
shows the tz shift away from my system default of America/Los_Angeles
, the output from SystemTime
is stable.
eb0bf1e
to
b759f6e
Compare
SQS already had support for delays. This diff adds support for all the remaining backends _except for GCP_ which does not provide a direct way to emulate the delay behavior. The redis impl is by far the most complicated of the bunch. This version was based heavily on what was built for the OSS svix-server, with adjustments needed to account for "raw payloads" which omniqueue uses for persistence rather than encoding things as JSON. A single e2e test for each backend was added to demonstrate the delay behavior.
b759f6e
to
c9323b3
Compare
Looks good to me. |
SQS already had support for delays.
This diff adds support for all the remaining backends except for GCP which does not provide a direct way to emulate the delay behavior.
The redis impl is by far the most complicated of the bunch. This version was based heavily on what was built for the OSS svix-server, with adjustments needed to account for "raw payloads" which omniqueue uses for persistence rather than encoding things as JSON.
A single e2e test for each backend was added to demonstrate the delay behavior.