Quantcast
Viewing latest article 1
Browse Latest Browse All 26

How to use EventMachine(superfeeder-ruby gem) within a Rails controller?

thank you for taking a look at this.

I am new to rails, unfortunately. I currently have to implement an endpoint that Superfeedr can push updates to, but that endpoint has to be in a rails controller.

Initially it seemed to me that this should be a background job that runs and the rest of the web tends to agree, but I am being pressured to include this as a rails controller - which confuses me. I am not certain how to include EventMachine in a request/response cycle.

I know the web is full of examples, but none really answer my question with how to route this. I have no idea.

I have a rails controller, called Superfeeds. I want Superfeeder to push updates to something like myrailsapp/superfeeds/

Inside feeds I want to inspect the pushed content, and then write the results of that to another controller that actually has a model and will persist it.

Basically, the controller called Feeds just needs to receive and pass the information along. This confuses me however because it seems to have to implement something which is a long running process inside of a rails controller - and I am not even sure if this can work.

Does anyone know of a way that this has been done with rails, but not using EventMachine as a background job? In the end I really just need to know that this is possible.

-L


Viewing latest article 1
Browse Latest Browse All 26

Trending Articles