# Avoid web-service delay on an action

**URL:** <https://www.ruby-forum.com/t/avoid-web-service-delay-on-an-action/185305>\
**Category:** Rails\
**Created:** [March 17, 2010, 7:34pm UTC](https://www.ruby-forum.com/t/avoid-web-service-delay-on-an-action/185305 "2010-03-17T19:34:07Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![mhfs](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/b2d939/32.png) [@mhfs](https://www.ruby-forum.com/u/mhfs)\
**Post date:** [March 17, 2010, 7:34pm UTC](https://www.ruby-forum.com/t/avoid-web-service-delay-on-an-action/185305/1 "2010-03-17T19:34:07Z")

</div>

Hello all,

In a controller action, there is a call to Twitter’s update. While it  
works  
as expected, it indoubtedly added some delay to the action processing  
time.  
What I would like to do is push this twitter update to another thread or  
to  
the background.

I know I could use one of the many queue processing engines around do to  
such thing, but it is for such a simple issue that I would like to ask  
for  
other’s people wisdom before proceeding.

Any suggestions appreciated.

Thanks,

Marcelo.

---

<div class="post-metadata">

**Author:** ![mhfs](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/b2d939/32.png) [@mhfs](https://www.ruby-forum.com/u/mhfs)\
**Post date:** [March 17, 2010, 8:38pm UTC](https://www.ruby-forum.com/t/avoid-web-service-delay-on-an-action/185305/2 "2010-03-17T20:38:48Z")

</div>

Marcelo de Moraes S. wrote:

> In a controller action, there is a call to Twitter’s update. While it  
> works  
> as expected, it indoubtedly added some delay to the action processing  
> time.  
> What I would like to do is push this twitter update to another thread or  
> to  
> the background.
> 
> I know I could use one of the many queue processing engines around do to  
> such thing, but it is for such a simple issue that I would like to ask  
> for  
> other’s people wisdom before proceeding.

Sound like an excellent use case for delay\_job (or similar) to me.

---

<div class="post-metadata">

**Author:** ![mhfs](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/b2d939/32.png) [@mhfs](https://www.ruby-forum.com/u/mhfs)\
**Post date:** [March 17, 2010, 8:39pm UTC](https://www.ruby-forum.com/t/avoid-web-service-delay-on-an-action/185305/3 "2010-03-17T20:39:39Z")

</div>

Robert W. wrote:

> Sound like an excellent use case for delay\_job (or similar) to me.

Oops. I meant up type delayed\_job…

---

<div class="post-metadata">

**Author:** ![mhfs](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/b2d939/32.png) [@mhfs](https://www.ruby-forum.com/u/mhfs)\
**Post date:** [March 24, 2010, 5:41am UTC](https://www.ruby-forum.com/t/avoid-web-service-delay-on-an-action/185305/4 "2010-03-24T05:41:51Z")

</div>

Thank you!
