# Make a system call and proceed without waiting for result?

**URL:** <https://www.ruby-forum.com/t/make-a-system-call-and-proceed-without-waiting-for-result/149661>\
**Category:** Rails\
**Created:** [September 27, 2008, 5:48pm UTC](https://www.ruby-forum.com/t/make-a-system-call-and-proceed-without-waiting-for-result/149661 "2008-09-27T17:48:31Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![cmaxvv](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/85f322/32.png) [@cmaxvv](https://www.ruby-forum.com/u/cmaxvv)\
**Post date:** [September 27, 2008, 5:48pm UTC](https://www.ruby-forum.com/t/make-a-system-call-and-proceed-without-waiting-for-result/149661/1 "2008-09-27T17:48:31Z")

</div>

This is probably a general ruby question: in one of my models i need to  
make loads (up to 600 or so) of system calls with the curl command.  
It’s a fire-and-forget kind of deal - i don’t care, at that particular  
moment, whether the calls were successful or not and i certainly don’t  
want to keep the user waiting for the html responses to come back.

Is it possible, with a call to ‘system’ (or some other method) to carry  
on without waiting for the results?

---

<div class="post-metadata">

**Author:** ![cmaxvv](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/85f322/32.png) [@cmaxvv](https://www.ruby-forum.com/u/cmaxvv)\
**Post date:** [September 27, 2008, 11:00pm UTC](https://www.ruby-forum.com/t/make-a-system-call-and-proceed-without-waiting-for-result/149661/2 "2008-09-27T23:00:33Z")

</div>

On Sat, 2008-09-27 at 17:48 +0200, Max W. wrote:

> This is probably a general ruby question: in one of my models i need to  
> make loads (up to 600 or so) of system calls with the curl command.  
> It’s a fire-and-forget kind of deal - i don’t care, at that particular  
> moment, whether the calls were successful or not and i certainly don’t  
> want to keep the user waiting for the html responses to come back.
> 
> Is it possible, with a call to ‘system’ (or some other method) to carry  
> on without waiting for the results?

* * *

backgroundrb

Craig

---

<div class="post-metadata">

**Author:** ![cmaxvv](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/85f322/32.png) [@cmaxvv](https://www.ruby-forum.com/u/cmaxvv)\
**Post date:** [September 28, 2008, 4:08am UTC](https://www.ruby-forum.com/t/make-a-system-call-and-proceed-without-waiting-for-result/149661/3 "2008-09-28T04:08:23Z")

</div>

Even simpler. Use ruby ‘fork’ method. Example:

#show time now  
puts Time.now  
fork do  
#long running process  
`sleep 20;curl -O www.somesite.com/bigfile.tgz`  
end  
#this time is nearly same as when we started, no delay  
puts Time.now

---

<div class="post-metadata">

**Author:** ![cmaxvv](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/85f322/32.png) [@cmaxvv](https://www.ruby-forum.com/u/cmaxvv)\
**Post date:** [October 2, 2008, 10:10am UTC](https://www.ruby-forum.com/t/make-a-system-call-and-proceed-without-waiting-for-result/149661/4 "2008-10-02T10:10:50Z")

</div>

blasterpal wrote:

> Even simpler. Use ruby ‘fork’ method. Example:
> 
> #show time now  
> puts Time.now  
> fork do  
> #long running process  
> `sleep 20;curl -O www.somesite.com/bigfile.tgz`  
> end  
> #this time is nearly same as when we started, no delay  
> puts Time.now

Great, thanks guys!
