Well thanks for taking the time to reply, I'll have a look into it. You 
wrote a long time ago, I was totally absorbed in a project.

Best regards,
Luc

On Thursday, 30 May 2019 14:33:13 UTC-4, Heiko Jansen wrote:
>
> Sorry, completely missed your follow-up...
>
> I'd say the synopsis of Mojo::IOLoop mostly shows what to do. Never tried 
> it myself, but something along these lines should work:
>
> use Mojo::IOLoop;
>
>
> my $id = Mojo::IOLoop->client({ path => '/tmp/myapp.sock' } => sub {
>   my ($loop, $err, $stream) = @_;
>  
>   $stream->on(read => sub {
>     my ($stream, $bytes) = @_;
>  
>     # Process input
>     say "Input: $bytes";
>   });
> });
>  
> # Start event loop if necessary
> Mojo::IOLoop->start unless Mojo::IOLoop->is_running;
>
> There may be other ways to achieve what you want, but this seems the 
> easiest solution to me.
> Of course there's no guarantee that your "read" callback is called exactly 
> once for one complete new syslog entry. You may receive only parts of one 
> log entry or a whole bunch of log entries at once and you have to parse and 
> split them yourself, sometimes waiting for the rest of an entry to bee 
> provided in the next call of your callback...
>

-- 
You received this message because you are subscribed to the Google Groups 
"Mojolicious" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/mojolicious/0fbd986d-f88b-4e9e-80f7-893bd2261833%40googlegroups.com.

Reply via email to