Questions tagged [wisper]

Wisper is a Ruby Publish-Subscribe gem with async support which aims to help decouple responsibilities.

Wisper was extracted from a Rails codebase but is not dependant on Rails.

It is commonly used as an alternative to ActiveRecord callbacks, Observers and Concerns to reduce coupling and make testing easier.

21 questions
0
votes
1 answer

Is it possible to have one subscription apply to multiple listeners with Wisper?

I have a service that broadcast an event when some criteria is satisfied. I also have several customer specific services. I want the customer services to be notified of the event. However, I would rather not add a subscription to the broadcasting…
David
  • 1
  • 1
0
votes
0 answers

how to pass data from api to other controller in rails?

I have a api which accepts and saves data in rails. I would like to get that data on the current UI as flash how to do it ? I tried to wisper gem and flash alerts are not supported. $ cat app/controllers/api/v1/sms_controller.rb class…
Kiran Patil
  • 421
  • 1
  • 5
  • 18
0
votes
1 answer

Rails "test" environment has access to non-included methods

I'm using the fantastic wisper gem to react to changes in my models(Rails 4.1). Class Transaction < ActiveRecord::Base #include Wisper::Publisher after_save { broadcast(:transaction_saved)} end Here broadcast is a method provided by the…
lllllll
  • 4,715
  • 6
  • 29
  • 42
0
votes
1 answer

Is it possible to handle Global Listeners Async using Wisper?

I am looking at implementing Wisper into an existing Rails application... I have been running the examples as a POC and I don't see a way to set up Events to be asynchronous when setting up listeners globally. Is this not possible?
El Guapo
  • 5,581
  • 7
  • 54
  • 82
0
votes
1 answer

Wisper: unsubscribing GlobalListeners between requests

I want to register a global listener in my ApplicationController, that contains the current_user. I ended up trying this: class ApplicationController < ActionController::Base before_action do @listener = MyListener.new(current_user) …
bugzpodder
  • 29
  • 1
  • 6
0
votes
1 answer

How to use Wisper with different instances of same Active Record Model?

I'm trying to use Wisper with Rails 4 / AR and encountering an issue. Let's say I have Email and Creep AR models, and I want the Creep to know when a reply was received (Creep is not necessarily the sender...) So I do: email = Email.create!…
delight
  • 1
  • 1
1
2