Git Product home page Git Product logo

cellular's People

Contributors

3lvis avatar clyfe avatar gauravtiwari avatar jgorset avatar jozosalt avatar rlqualls avatar sindrenm avatar str1fe avatar t0ggah avatar timkurvers avatar toothfairy avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

cellular's Issues

Improve documentation on Sidekiq's queue name

By default, the Sidekiq job uses the cellular queue which mean you have to add it to your Sidekiq configuration, like:

$ sidekiq -q default -q cellular

or

# config/sidekiq.yml
:queues:
  - default
  - cellular

The problem with this config is that is accidentally implying importance. This means that the default queue has more priority than the cellular queue.

If you want to use the weight for both queues, you can do:

$ sidekiq -q default,1 -q cellular,1

or

# config/sidekiq.yml
:queues:
  - [default, 1]
  - [cellular, 1]

Another fix is to use the default queue instead of cellular, and provide a way to override the default queue name. This is not backward compatible, but it plays good with common production setups:

# config/sidekiq.yml
:queues:
  - [high, 4]
  - [default, 2]
  - [low, 1]

Right now, I'm using this config:

# config/sidekiq.yml
:queues:
  - [high, 4]
  - [default, 2]
  - [mailers, 2]
  - [low, 1]

I'm not using the cellular queue but it's there just in case a developer uses deliver_async without specifying a queue. I would like to remove it, so Sidekiq doesn't have to poll an unused queue.

References:

Sidekiq Advanced Options

Refactor Cellular::Backends::Log

We should rename Cellular::Backends::Log to Cellular::Backends::Test and make the deliveries array available on it rather than the Cellular module.
#9

3.0.0

  • Remove unneeded dependencies (e.g. having savon when only using the Twilio backend).
  • Better integration with ActiveJob. Right now it tries to load Sidekiq even when it uses ActiveJob as an interface.
  • Better test helper.
  • Check what backends should we support.
  • #26 Don't mutate given options hash.
  • #28 Be able to configure default queue name.
  • #2 Check if SMS was delivered
  • Add support for Ruby 2.4 - Currently there are some failing tests.
  • Add support for Rails 5.0+
  • Remove Rails dependency. It should be possible to use it outside Rails.

Log to development.log

Cellular::Backend::Logs currently logs to STDOUT, whereas ActionMailer logs to log/development.log.

This causes SMS to appear in the output from rails server, whereas e-mail appear in log/development.log.

We should probably do that, too.

Bang-method for delivery

The current deliver-method completes gracefully regardless of delivery status.

Under certain circumstances it might be useful to have Cellular raise an exception in case of a failed delivery: SMS::deliver!

Introduce Cellular::Backend as a base for all backends

Proposal to deprecate Cellular::Backends and introduce:

class Cellular::Backend
  def deliver(...)
    raise NotImplementedError  
  end
end

class Cellular::Backend::HyperSMS < Cellular::Backend; end

For backwards compatibility we could point Cellular::Backends to Cellular::Backend.

Introduce Cellular::Delivery that will be returned by SMSs as unified delivery status

At present an SMS is marked as delivered regardless of whether a backend ran into issues processing it.

We should set up a uniform delivery object, for example:

class Cellular::Delivery
  attr_reader :sms, :receipt

  delegate :success?, :failure?, to: :receipt
end

class Cellular::Receipt
  attr_reader :status, :message, :raw

  def success?; end
  def failure?; end
end

Cellular::SMS#deliver would receive a Cellular::Receipt from a backend, construct a delivery instance and be able to use this receipt to set delivery status as well as return the delivery back to the caller for further processing if required.

For testing purposes, this delivery object (as well as the actual SMS and the backend receipt) will be available in testing backend, see #10.

Ensure sending over TLSv1 towards Sendega

Sending texts through Sendega doesn't work by default, unless we specify the default SSL version for Excon to be TLSv1:

Excon.defaults[:ssl_version] = :TLSv1

While we could specify this in the application, it'd be better to set it specifically when sending through Sendega, as setting it globally in the application might cause an issue elsewhere.

Silence Savon logs

Savon defaults to spamming you with logs. We should default to not doing that.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.