Sponsored Content
Operating Systems SCO Converting existing SCO V.5.0.5 to a VM Post 302672073 by TheSniper on Sunday 15th of July 2012 08:58:20 PM
Old 07-15-2012
Tuned in watching !
 

4 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

folder existing and file existing

I want to look into a folder to see if there are any folders within it. If there are, I need to check inside each folder to see if it contains a .pdf file So If /myserver/myfolder/ contains a folder AND that folder conatins a .pdf file do X Else do Z I may have multiple folders and... (4 Replies)
Discussion started by: crowman
4 Replies

2. Solaris

Add existing user into an existing group

Pre: no gpasswd/adduser there is just usermod can be used, also there is no -a option for usermod. How should I add a user into a group? (4 Replies)
Discussion started by: a2156z
4 Replies

3. Shell Programming and Scripting

insert pipes for existing and non-existing records

I have a source file like this, L4058S462 34329094 F51010141TK1070000483L4058S462 34329094 0232384840 381892 182 5690 L4058S462 34329094 F51020141FIRST CLEARING, LLC A/C 3432-9094 L4058S462 34329094 F51030141JOHAN HOLMQVIST ... (1 Reply)
Discussion started by: saravanamr
1 Replies

4. UNIX for Dummies Questions & Answers

Appending lines from an existing list to each line in another existing list

Evening all ! I would like to ask your expertise on how to accomplish the following ; I have 2 lists, and would like each line from list2 to be appended to each line in list1, resulting in list3 ; List1; alpha beta charlie List2; one two three (4 Replies)
Discussion started by: TAPE
4 Replies
Mojo::IOLoop::Stream(3pm)				User Contributed Perl Documentation				 Mojo::IOLoop::Stream(3pm)

NAME
Mojo::IOLoop::Stream - Non-blocking I/O stream SYNOPSIS
use Mojo::IOLoop::Stream; # Create stream my $stream = Mojo::IOLoop::Stream->new($handle); $stream->on(read => sub { my ($stream, $chunk) = @_; ... }); $stream->on(close => sub { my $stream = shift; ... }); $stream->on(error => sub { my ($stream, $err) = @_; ... }); # Start and stop watching for new data $stream->start; $stream->stop; DESCRIPTION
Mojo::IOLoop::Stream is a container for I/O streams used by Mojo::IOLoop. EVENTS
Mojo::IOLoop::Stream can emit the following events. "close" $stream->on(close => sub { my $stream = shift; ... }); Emitted safely if the stream gets closed. "drain" $stream->on(drain => sub { my $stream = shift; ... }); Emitted safely once all data has been written. "error" $stream->on(error => sub { my ($stream, $err) = @_; ... }); Emitted safely if an error happens on the stream. "read" $stream->on(read => sub { my ($stream, $chunk) = @_; ... }); Emitted safely if new data arrives on the stream. "timeout" $stream->on(timeout => sub { my $stream = shift; ... }); Emitted safely if the stream has been inactive for too long and will get closed automatically. "write" $stream->on(write => sub { my ($stream, $chunk) = @_; ... }); Emitted safely if new data has been written to the stream. ATTRIBUTES
Mojo::IOLoop::Stream implements the following attributes. "reactor" my $reactor = $stream->reactor; $stream = $stream->reactor(Mojo::Reactor::Poll->new); Low level event reactor, defaults to the "reactor" attribute value of the global Mojo::IOLoop singleton. "timeout" my $timeout = $stream->timeout; $stream = $stream->timeout(45); Maximum amount of time in seconds stream can be inactive before getting closed automatically, defaults to 15. Setting the value to 0 will allow this stream to be inactive indefinitely. METHODS
Mojo::IOLoop::Stream inherits all methods from Mojo::EventEmitter and implements the following new ones. "new" my $stream = Mojo::IOLoop::Stream->new($handle); Construct a new Mojo::IOLoop::Stream object. "close" $stream->close; Close stream immediately. "handle" my $handle = $stream->handle; Get handle for stream. "is_readable" my $success = $stream->is_readable; Quick non-blocking check if stream is readable, useful for identifying tainted sockets. "is_writing" my $success = $stream->is_writing; Check if stream is writing. "start" $stream->start; Start watching for new data on the stream. "stop" $stream->stop; Stop watching for new data on the stream. "steal_handle" my $handle = $stream->steal_handle; Steal handle from stream and prevent it from getting closed automatically. "write" $stream->write('Hello!'); $stream->write('Hello!', sub {...}); Write data to stream, the optional drain callback will be invoked once all data has been written. SEE ALSO
Mojolicious, Mojolicious::Guides, <http://mojolicio.us>. perl v5.14.2 2012-09-05 Mojo::IOLoop::Stream(3pm)
All times are GMT -4. The time now is 09:58 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy