Skip to content
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

Add JRuby / JDBC support for LISTEN #479

Merged
merged 1 commit into from
Jan 9, 2022
Merged

Add JRuby / JDBC support for LISTEN #479

merged 1 commit into from
Jan 9, 2022

Conversation

bensheldon
Copy link
Owner

@tedhexaflow fyi, I'd love your feedback on this

@bensheldon bensheldon added the enhancement New feature or request label Jan 6, 2022
@bensheldon bensheldon temporarily deployed to goodjob-jruby-listen-2ecozln4p January 6, 2022 01:47 Inactive
@bensheldon bensheldon temporarily deployed to goodjob-jruby-listen-2ecozln4p January 6, 2022 02:21 Inactive
@tedt10e
Copy link
Contributor

tedt10e commented Jan 6, 2022

Hi @bensheldon,

I'm not very familiar with postgre Listen/Notify features.

Is there any specific you would like me to check?

Thanks.

@bensheldon
Copy link
Owner Author

@tedhexaflow I think mainly I'm curious about:

  • I'm assuming that the JDBC interface is very stable. Should I be doing some deeper duck-typing/method testing to ensure that getNotifications exists? The docs make me think it's stable.
  • Is there any downside you can think of to polling the database every second with a noop query? I assume that Java is even better at parallelization than MRI would be.

And I guess more generally, I think LISTEN/NOTIFY for JRuby is exciting and brings parity between MRI and JRuby in GoodJob's benefits of low-latency job execution, so any confidence boosting there is appreciated 😄

And lastly, I wonder if I should suggest that this be implemented in Rails ActionCable Postgres adapter too, because that's what inspired GoodJob's implementation: https://github.com/rails/rails/blob/ce3db04cd74ed267fb083a1342672194912ea87d/actioncable/lib/action_cable/subscription_adapter/postgresql.rb#L106-L108

@bensheldon bensheldon temporarily deployed to goodjob-jruby-listen-2ecozln4p January 6, 2022 18:57 Inactive
@tedt10e
Copy link
Contributor

tedt10e commented Jan 7, 2022

Hi @bensheldon

Thanks for the detail.

I think I am not the right person to provide helpful feedback for those questions.

Let me try to reach Charles @headius from JRuby and ask for help to provide feedback.

@headius
Copy link

headius commented Jan 7, 2022

@bensheldon @tedhexaflow I don't know much about this library or about Postgres notifications in general, but...

  • Anything in JDBC should be stable and work well with JRuby, so I assume notifications are included in that.
  • Background polling should not affect performance of foreground workers/threads in JRuby, so I don't see a problem there.

We're happy to help make JRuby support happen, if that means answering questions, fixing JRuby-related issues, or understanding Java APIs. Stop by our Matrix channel if you need anything!

@bensheldon bensheldon temporarily deployed to goodjob-jruby-listen-2ecozln4p January 8, 2022 00:53 Inactive
@bensheldon
Copy link
Owner Author

@headius thank you! That's really helpful context. I joined the Matrix channel and I'll definitely bring my questions there. Thanks again!

@tedt10e
Copy link
Contributor

tedt10e commented Jan 8, 2022

Thank you so much 🙏 @headius.

@bensheldon bensheldon merged commit 0b45dbb into main Jan 9, 2022
@bensheldon bensheldon deleted the jruby_listen branch January 9, 2022 16:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants