Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

mojo::ioloop::delay(3pm) [debian man page]

Mojo::IOLoop::Delay(3pm)				User Contributed Perl Documentation				  Mojo::IOLoop::Delay(3pm)

NAME
Mojo::IOLoop::Delay - Synchronize events SYNOPSIS
use Mojo::IOLoop::Delay; # Synchronize multiple events my $delay = Mojo::IOLoop::Delay->new; $delay->on(finish => sub { say 'BOOM!' }); for my $i (1 .. 10) { $delay->begin; Mojo::IOLoop->timer($i => sub { say 10 - $i; $delay->end; }); } # Wait for events if necessary $delay->wait unless Mojo::IOLoop->is_running; DESCRIPTION
Mojo::IOLoop::Delay synchronizes events for Mojo::IOLoop. EVENTS
Mojo::IOLoop::Delay can emit the following events. "finish" $delay->on(finish => sub { my $delay = shift; ... }); Emitted safely once the active event counter reaches zero. ATTRIBUTES
Mojo::IOLoop::Delay implements the following attributes. "ioloop" my $ioloop = $delay->ioloop; $delay = $delay->ioloop(Mojo::IOLoop->new); Loop object to control, defaults to the global Mojo::IOLoop singleton. METHODS
Mojo::IOLoop::Delay inherits all methods from Mojo::EventEmitter and implements the following new ones. "begin" my $cb = $delay->begin; Increment active event counter, the returned callback can be used instead of "end". my $delay = Mojo::IOLoop->delay; Mojo::UserAgent->new->get('mojolicio.us' => $delay->begin); my $tx = $delay->wait; "end" $delay->end; $delay->end(@args); Decrement active event counter. "wait" my @args = $delay->wait; Start "ioloop" and stop it again once the "finish" event gets emitted, only works when "ioloop" is not running already. # Use the "finish" event to synchronize portably $delay->on(finish => sub { my ($delay, @args) = @_; ... }); $delay->wait unless $delay->ioloop->is_running; SEE ALSO
Mojolicious, Mojolicious::Guides, <http://mojolicio.us>. perl v5.14.2 2012-09-05 Mojo::IOLoop::Delay(3pm)

Check Out this Related Man Page

Mojo::Server::PSGI(3pm) 				User Contributed Perl Documentation				   Mojo::Server::PSGI(3pm)

NAME
Mojo::Server::PSGI - PSGI server SYNOPSIS
use Mojo::Server::PSGI; my $psgi = Mojo::Server::PSGI->new; $psgi->unsubscribe('request'); $psgi->on(request => sub { my ($psgi, $tx) = @_; # Request my $method = $tx->req->method; my $path = $tx->req->url->path; # Response $tx->res->code(200); $tx->res->headers->content_type('text/plain'); $tx->res->body("$method request for $path!"); # Resume transaction $tx->resume; }); my $app = $psgi->to_psgi_app; DESCRIPTION
Mojo::Server::PSGI allows Mojo applications to run on all PSGI compatible servers. See Mojolicious::Guides::Cookbook for more. EVENTS
Mojo::Server::PSGI inherits all events from Mojo::Server. METHODS
Mojo::Server::PSGI inherits all methods from Mojo::Server and implements the following new ones. "run" my $res = $psgi->run($env); Run PSGI. "to_psgi_app" my $app = $psgi->to_psgi_app; Turn Mojo application into PSGI application. SEE ALSO
Mojolicious, Mojolicious::Guides, <http://mojolicio.us>. perl v5.14.2 2012-09-05 Mojo::Server::PSGI(3pm)
Man Page

14 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Login Delay

When telneting to a SUN box and incorrectly spelling your password, there is a delay of approx. 5 seconds. Is there any way to shorten this time? OS solaris 7 (1 Reply)
Discussion started by: SmartJuniorUnix
1 Replies

2. Shell Programming and Scripting

help with command

I am new to programming using the korn shell and I have a question: Is there a way to take all the data in a file and insert it in another file, but between begin and end. Example below begin <-- Insert text here --> end Any suggustions would be much appreciated.<-- Insert text here... (2 Replies)
Discussion started by: supercbw
2 Replies

3. UNIX for Dummies Questions & Answers

jumpstart - finish scripts

hi, where i can find some help on how to write finish scripts for jump-start?? i tried sun-blueprints but i couldnt find it... (2 Replies)
Discussion started by: dorilevy
2 Replies

4. Programming

Introducing Delay less then a second.

Hi, I have a doubt in introducing a delay in the programs. We know that we do have a sleep() function/api using which we can bring a delay in terms of seconds. A minimum delay can be atleast 1 second. Now I'm bothered about how to introduce a delay that is just less than a second. Like... (3 Replies)
Discussion started by: S.Vishwanath
3 Replies

5. AIX

end of case

hello How can I go out to a "case" boucle, but not finish the program : echo " your choice :" read grp1 do case ${grp1} in 1)grp1="toto1";; 2)grp1="toto2";; 3)grp1="toto3";; 4)grp1="toto4";; 5)grp1=t;; 6)grp1=t;; ... (3 Replies)
Discussion started by: pascalbout
3 Replies

6. Programming

Delay a process.

How to delay a process. I need to to delay a process from 3sec. At that 3sec other back ground processes also should stop. (just sit 3sec for idle & then starts execution as normally) I use sleep(3)-But it not stop the bg processes I try to use loop but it not gurantee to wait 3sec. ... (2 Replies)
Discussion started by: ugp
2 Replies

7. UNIX for Dummies Questions & Answers

how do i finish this last one..

i tried to build a command to replaces the word "include" with "exclude" in each *.h type of file in a certain directory and to display the lines in which the switch happened. i did a command and i dont know why its not working find /usr -name "*.h" -exec sed 's/include/exclude/g' {} \;... (2 Replies)
Discussion started by: newby2
2 Replies

8. Shell Programming and Scripting

how to introduce delay in the script??(urgent)

Hi all, i would like to know how to introduce a delay in the execution of a cmd? am trying to copy a file which is about 650 mb and then perform some actions on it.. however since its huge i would like to introduce a delay in exection until the process is over i dont want it to proceed to... (10 Replies)
Discussion started by: wrapster
10 Replies

9. UNIX for Advanced & Expert Users

commands do not finish

Hi, I have strange problem executing some command on solaris 5.9 ps command does not finish(hangs) and runs forever without any result. same with cc command too.Please suggest (1 Reply)
Discussion started by: Raom
1 Replies

10. News, Links, Events and Announcements

mojoslinux.com

I have put together a website for Unix and Linux Lovers. It's only about 30% completed but I'm going to keep working on it. Please visit it and leave me any tips or suggestions. Mojo's Linux Blog - Mojo's Blog (1 Reply)
Discussion started by: aojmoj
1 Replies

11. Shell Programming and Scripting

Print line ........ with delay

Hello Guruz, Could some please tell me how can I print via shell script “..............” with specific delay of 1 sec per “.” I tried this, but it's started printing one by one. (2 Replies)
Discussion started by: bullz26
2 Replies

12. Shell Programming and Scripting

Loop without a delay

Hi, I am trying to understand what would happen if ther is a loop without any delay like sleep statement, I feel that would add a lot of load onto the CPU. Trying to understand how the load is reduced by the introduction of sleep(). Thanks and regards Zulfi (3 Replies)
Discussion started by: zulfi123786
3 Replies

13. Shell Programming and Scripting

Bit of a math question

I have a number, say 174. I need to write bash code that will find the first larger number that ends in 99. That would be 199 in this case. If the number were 1263, I would be looking for 1299, for 175438, I would want 175499, etc. If the numbers were always three digit, I could just grab the... (11 Replies)
Discussion started by: LMHmedchem
11 Replies

14. Shell Programming and Scripting

BASH Execution Delay / Speedup

I have a BASH script that runs a continuous loop, reading a line from a file, and then spawning a background process to use it. I've placed "date" commands inside it to see where it's slowing down, and everything inside -- including reading the line from the file -- is fast, but the loop bogs... (34 Replies)
Discussion started by: gmark99
34 Replies