[Jifty-commit] r2097 - in jifty/trunk: lib/Jifty/Script lib/Jifty/Subs

jifty-commit at lists.jifty.org jifty-commit at lists.jifty.org
Mon Oct 30 23:49:29 EST 2006


Author: jesse
Date: Mon Oct 30 23:49:28 2006
New Revision: 2097

Modified:
   jifty/trunk/   (props changed)
   jifty/trunk/lib/Jifty/Script/Schema.pm
   jifty/trunk/lib/Jifty/Subs/Render.pm

Log:
 r29629 at pinglin:  jesse | 2006-10-30 23:45:06 -0500
  * Added support to Subs::Render for reporting how many messages we've sent to the client


Modified: jifty/trunk/lib/Jifty/Script/Schema.pm
==============================================================================
--- jifty/trunk/lib/Jifty/Script/Schema.pm	(original)
+++ jifty/trunk/lib/Jifty/Script/Schema.pm	Mon Oct 30 23:49:28 2006
@@ -224,10 +224,10 @@
        #   This *will* try to generate SQL for abstract base classes you might
        #   stick in $AC::Model::.
         next unless $model->isa( 'Jifty::Record' );
-        do { $log->info("Skipping $model"); next }
-            if ( $model->can( 'since' )
-            and ($model =~ /^Jifty::Model::/ ? $jiftyv : $appv) < $model->since );
-
+        if ( $model->can( 'since' ) and ($model =~ /^Jifty::Model::/ ? $jiftyv : $appv) < $model->since ) {
+            $log->info("Skipping $model"); 
+            next;
+        }
         $log->info("Using $model");
         my $ret = $self->{'_schema_generator'}->add_model( $model->new );
         $ret or die "couldn't add model $model: " . $ret->error_message;

Modified: jifty/trunk/lib/Jifty/Subs/Render.pm
==============================================================================
--- jifty/trunk/lib/Jifty/Subs/Render.pm	(original)
+++ jifty/trunk/lib/Jifty/Subs/Render.pm	Mon Oct 30 23:49:28 2006
@@ -25,6 +25,9 @@
     my ( $class, $id, $callback ) = @_;
     my $got;
 
+    # # of fragments sent
+    my $sent = 0;
+
     # Get the IPC::PubSub::Subscriber object and do one fetch of all new
     # events it subscribes to, and put those into $got.
     my $subs
@@ -43,6 +46,8 @@
             # XXX - We don't yet use $timestamp here.
             my ( $timestamp, $msg ) = @$rv;
 
+
+
             # Channel name is always App::Event::Class-MD5QUERIES
             my $event_class = $channel;
             $event_class =~ s/-.*//;
@@ -52,6 +57,8 @@
                 $event_class = Jifty->config->framework('ApplicationClass')."::Event";
             }
 
+            Jifty->log->debug("Rendering $channel event $msg");
+
             my $render_info = $render->{$channel};
             my $region      = Jifty::Web::PageRegion->new(
                 name => $render_info->{region},
@@ -70,11 +77,11 @@
                     $event_object->render_arguments,
                 }
             );
-            $callback->(
-                $render_info->{mode}, $region->qualified_name, $region_content
-            );
+            $callback->( $render_info->{mode}, $region->qualified_name, $region_content);
+            $sent++;
         }
     }
+    return ($sent);
 }
 
 1;


More information about the Jifty-commit mailing list