SXS
SNS/SQS wrapper to make development (Redis) and test (Memory) environment transparent.
Install
Add the following code on your Gemfile and run bundle install:
gem 'sxs'
Run the following task to create a SXS migration:
rails g sxs:install
Usage
SXS::Publisher.new('sqs_url', provider: :sqs).publish({ body: 'value' }.to_json)
SXS::Publisher.new('sns_url', provider: :sns).publish({ body: 'value' }.to_json)
SXS::Publisher.new('some_key', provider: :redis).publish({ body: 'value' }.to_json)
SXS::Publisher.new('some_key', provider: :memory).publish({ body: 'value' }.to_json)
If you do not specify the provider you will get:
development: :redis
production: ArgumentError
test: :memory