https://github.com/wbotelhos/sxs
SNS and SQS Wrapper.
https://github.com/wbotelhos/sxs
aws memory publisher redis sns sqs
Last synced: about 2 months ago
JSON representation
SNS and SQS Wrapper.
- Host: GitHub
- URL: https://github.com/wbotelhos/sxs
- Owner: wbotelhos
- License: mit
- Created: 2019-08-26T10:59:33.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2019-09-30T19:23:01.000Z (about 6 years ago)
- Last Synced: 2025-01-28T03:18:46.556Z (9 months ago)
- Topics: aws, memory, publisher, redis, sns, sqs
- Language: Ruby
- Homepage: http://patreon.com/wbotelhos
- Size: 24.4 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# SXS
[](https://travis-ci.org/wbotelhos/sxs)
[](https://badge.fury.io/rb/sxs)
[](https://codeclimate.com/github/wbotelhos/sxs/maintainability)
[](https://www.patreon.com/wbotelhos)SNS/SQS wrapper to make `development` (Redis) and `test` (Memory) environment transparent.
## Install
Add the following code on your `Gemfile` and run `bundle install`:
```ruby
gem 'sxs'
```Run the following task to create a SXS migration:
```bash
rails g sxs:install
```## Usage
```ruby
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)
```On `development` and `test` environment `provider` be overwrited for the following:
```ruby
development: :redis
test: :memory
```To avoid this ovewrite you can specify the provider via ENV `SXS_PROVIDER`. This will overwrites `production` too.