typester (owner)

Revisions

gist: 188437 Download_button fork
public
Public Clone URL: git://gist.github.com/188437.git
Embed All Files: show embed
0001-add-on_error-to-stream-handler.patch #
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
From 837ffd5cd282df217863cb5593271d66308d4bd7 Mon Sep 17 00:00:00 2001
From: Daisuke Murase <typester@cpan.org>
Date: Thu, 17 Sep 2009 19:21:44 +0900
Subject: [PATCH] add on_error to stream handler
 
---
 lib/AnyEvent/Twitter/Stream.pm | 4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)
 
diff --git a/lib/AnyEvent/Twitter/Stream.pm b/lib/AnyEvent/Twitter/Stream.pm
index 31971b3..fbbdc57 100644
--- a/lib/AnyEvent/Twitter/Stream.pm
+++ b/lib/AnyEvent/Twitter/Stream.pm
@@ -77,6 +77,10 @@ sub new {
             Scalar::Util::weaken($self);
 
             if ($handle) {
+ $handle->on_error(sub {
+ undef $handle;
+ $on_error->(@_);
+ });
                 $handle->on_eof(sub {
                     undef $handle;
                     $on_eof->(@_);
--
1.6.0.2