Skip to content

Allow faraday client configuration #138

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

srook
Copy link

@srook srook commented Apr 14, 2025

Enable additional configuration of Faraday client, allowing usage of different Faraday middleware.

This PR also partially resolves #59, as it allows configuring retry middleware.

@@ -202,6 +203,7 @@ def for_uri(uri, extra_headers = {})
extra_headers.each do |key, value|
faraday.headers[key] = value
end
@faraday_configurer.call(faraday) if @faraday_configurer
Copy link

Choose a reason for hiding this comment

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

Style/SafeNavigation: Use safe navigation (&.) instead of checking if an object exists before calling the method.

@@ -12,10 +12,11 @@ class FCM
INSTANCE_ID_API = "https://iid.googleapis.com"
TOPIC_REGEX = /[a-zA-Z0-9\-_.~%]+/

def initialize(json_key_path = "", project_name = "", http_options = {})
def initialize(json_key_path = "", project_name = "", http_options = {}, faraday_configurer = nil)
Copy link

Choose a reason for hiding this comment

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

Style/StringLiterals: Prefer single-quoted strings when you don't need string interpolation or special symbols.
Metrics/LineLength: Line is too long. [100/80]

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.

Implement Retry with exponential backoff
1 participant