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

feat: return job ID from client push #78

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

juliantrueflynn
Copy link

@juliantrueflynn juliantrueflynn commented Jul 17, 2024

What did we change?

Have SidekiqPublisher::Worker.client_push return a job ID string, which matches the sidekiq gem behavior. Currently .client_push returns the inserted SidekiqPublisher::Job ActiveRecord instance.

Why are we doing this?

Having a consistent return value between the native sidekiq gem and the sidekiq_publisher gem makes things easier to handle. Otherwise clients have to juggle using #job_id method (for sidekiq_publisher gem) or the job ID string (for sidekiq gem). For example:

job = ExampleJob.perform_async
logger.info msg: "some example", job_id: job.try(:job_id) || job

How was it tested?

  • Specs
  • Locally
  • Staging

@juliantrueflynn juliantrueflynn force-pushed the jtf-return-jid-from-created-job branch 2 times, most recently from da39c83 to fa52e7c Compare July 17, 2024 03:01
What did we change?

Have `SidekiqPublisher::Worker.client_push` return a job ID string, which
matches the sidekiq gem behavior. Currently `.client_push` returns the inserted
`SidekiqPublisher::Job` ActiveRecord instance.

Why are we doing this?

Having a consistent return value between the native sidekiq gem and the
sidekiq_publisher gem makes things easier to handle. Otherwise clients have to
juggle using `#job_id` method (for sidekiq_publisher gem) or the job ID string
(for sidekiq gem). For example:

```rb
job = ExampleJob.perform_async
logger.info msg: "some example", job_id: job.try(:job_id) || job
```
@juliantrueflynn juliantrueflynn force-pushed the jtf-return-jid-from-created-job branch from fa52e7c to 3e28611 Compare July 17, 2024 03:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant