tembo-io / pgmq

A lightweight message queue. Like AWS SQS and RSMQ but on Postgres.
PostgreSQL License
2.68k stars 71 forks source link

feature request: possible to have send() use a specific date time not a delay #315

Closed RealZimboGuy closed 2 weeks ago

RealZimboGuy commented 1 month ago

Hi, is it possible for a new method or way to send a message when it will become available at a specific date and time. rather than trying to calculate a future date based on the duration

ie

select * from pgmq.send('my_queue', '{"hello": "world"}','2024-10-20 00:00:00');
ChuckHend commented 1 month ago

Yes this is definitely possible and we'd accept a PR for it. I would need think a bit about it, but some possible ways to do it would be to overload pgmq.send() so that the delay parameter accepts either an integer or a timestamp type. OR, perhaps we add a new function pgmq.send_at().

RealZimboGuy commented 1 month ago

I can try dive into the change and see where i end up. Will be quite a bit of learning if i have to go much into the rust side of the plugin.

ChuckHend commented 1 month ago

The postgres extension itself is all pl/pgsql now. You can add/modify the code in pgmq.sql, then follow the install steps in the contributing guide to install the new code locally as you develop it.

algora-pbc[bot] commented 1 month ago

💎 $250 bounty â€ĸ Tembo

Steps to solve:

  1. Start working: Comment /attempt #315 with your implementation plan
  2. Submit work: Create a pull request including /claim #315 in the PR body to claim the bounty
  3. Receive payment: 100% of the bounty is received 2-5 days post-reward. Make sure you are eligible for payouts

Thank you for contributing to tembo-io/pgmq!

Add a bounty â€ĸ Share on socials

Attempt Started (GMT+0) Solution
đŸŸĸ @Saturn225 Oct 17, 2024, 1:22:41 PM WIP
đŸŸĸ @Neptune650 Oct 17, 2024, 8:29:47 PM #320
Saturn225 commented 1 month ago

/attempt #315

Algora profile Completed bounties Tech Active attempts Options
@Saturn225 1 bounty from 1 project
Rust, Scala,
HTML
īšŸ302
Cancel attempt
Saturn225 commented 1 month ago

Can I get this assigned? I will push changes in the PR by EOD

cc: @ChuckHend

Neptune650 commented 1 month ago

/attempt #315

Algora profile Completed bounties Tech Active attempts Options
@Neptune650 2 bounties from 2 projects
C++, C,
Python & more
Cancel attempt
algora-pbc[bot] commented 1 month ago

💡 @Neptune650 submitted a pull request that claims the bounty. You can visit your bounty board to reward.

Neptune650 commented 2 weeks ago

@ChuckHend Hey there, I don't think I was rewarded... Could you please check it.

algora-pbc[bot] commented 2 weeks ago

🎉🎈 @Neptune650 has been awarded $300! 🎈🎊

ChuckHend commented 2 weeks ago

@ChuckHend Hey there, I don't think I was rewarded... Could you please check it.

Sorry for delay @Neptune650. Reward should be distributed now.

Neptune650 commented 2 weeks ago

@ChuckHend Hey there, I don't think I was rewarded... Could you please check it.

Sorry for delay @Neptune650. Reward should be distributed now.

@ChuckHend Thanks, I appreciate it.