novuhq / novu-ruby

Ruby SDK for Novu - The open-source notification infrastructure for engineers. 🚀
https://rubygems.org/gems/novu
MIT License
23 stars 10 forks source link

Feat: Add Exponential Retry Mechanism with Idempotency Headers #50

Closed Eazybright closed 8 months ago

Eazybright commented 10 months ago

This PR added the following features to the SDK:

  1. Exponential Retry Mechanism: Failed requests can be retried with configurable paramters

    client = Novu::Client.new(
    access_token: '<your-novu-api_key>', 
    idempotency_key: '<your-idempotency-key>',
    enable_retry: true, # it is disabled by default,
    retry_config: {
    max_retries: 3, 
    initial_delay: 4, 
    max_delay: 60
    }
    )
  2. Idempotency Key Provisioning:

    client = Novu::Client.new(
    access_token: '<your-novu-api_key>', 
    idempotency_key: '<your-idempotency-key>'
    )
  3. Adds Named Argument to client initialization: Before:

    client = Novu::Client.new('<your-novu-api_key>')

Now:

client = Novu::Client.new(access_token: '<your-novu-api_key>')