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(server): implement postgres queue driver #3030

Merged
merged 8 commits into from
Aug 4, 2023
Merged

Conversation

schoren
Copy link
Collaborator

@schoren schoren commented Aug 4, 2023

This PR implements a postgres queue driver

Changes

Checklist

  • tested locally
  • added new dependencies
  • updated the docs
  • added a test

Comment on lines +8 to +14
type loggerFn func(string, ...any)

func newLoggerFn(name string) loggerFn {
return func(format string, params ...any) {
log.Printf("[%s] %s", name, fmt.Sprintf(format, params...))
}
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is useful even outside of this package. Perhaps we could move it to a specific infra package in the future?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, I found the pattern very useful, but if we want to improve our logging I would make it a bit more sophisticated

return
}

ctx, cancelCtx := context.WithTimeout(context.Background(), 500*time.Millisecond)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we add this 500ms timeout as a constant? Something like enqueueTimeout?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done!

@schoren schoren merged commit f296ab5 into main Aug 4, 2023
30 checks passed
@schoren schoren deleted the pg-queue-driver branch August 4, 2023 18:08
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.

3 participants