[Bio] / FigKernelPackages / ServerThing.pm Repository:
ViewVC logotype

Diff of /FigKernelPackages/ServerThing.pm

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.85, Thu Jan 5 20:07:03 2012 UTC revision 1.86, Thu Jan 5 20:54:03 2012 UTC
# Line 193  Line 193 
193          UUID::unparse($uuid, $uuid_str);          UUID::unparse($uuid, $uuid_str);
194    
195          my $encoding = $cgi->param('encoding') || 'yaml';          my $encoding = $cgi->param('encoding') || 'yaml';
196          my $type = $encoding eq 'yaml' ? 'application/yaml' : 'application/json';  
197            my $type;
198            if ($encoding eq 'yaml')
199            {
200                $type = 'application/yaml';
201            }
202            elsif ($encoding eq 'yaml2')
203            {
204                $type = 'application/yaml2';
205            }
206            else
207            {
208                $type = 'application/json';
209            }
210    
211          print STDERR "publish request to $exchange_name rpc.$function\n";          print STDERR "publish request to $exchange_name rpc.$function\n";
212          $conn->publish($channel, "rpc.$function", $cgi->param('args'),          $conn->publish($channel, "rpc.$function", $cgi->param('args'),
# Line 421  Line 434 
434      my $function = $cgi->param('function');      my $function = $cgi->param('function');
435      my $publish_queue = "rpc.$function";      my $publish_queue = "rpc.$function";
436    
437    #    print STDERR Dumper($cgi, $req);
438      #      #
439      # Inspect the incoming request to see if we have one of the "slow queue"      # Inspect the incoming request to see if we have one of the "slow queue"
440      # requests. Currently these are only the blast-based assignment      # requests. Currently these are only the blast-based assignment
# Line 440  Line 454 
454      $logger->debug("Request received for $function correlation_id=$uuid_str");      $logger->debug("Request received for $function correlation_id=$uuid_str");
455    
456      my $encoding = $cgi->param('encoding') || 'yaml';      my $encoding = $cgi->param('encoding') || 'yaml';
457      my $type = $encoding eq 'yaml' ? 'application/yaml' : 'application/json';      my $type;
458        if ($encoding eq 'yaml')
459        {
460            $type = 'application/yaml';
461        }
462        elsif ($encoding eq 'yaml2')
463        {
464            $type = 'application/yaml2';
465        }
466        else
467        {
468            $type = 'application/json';
469        }
470    
471      my $now = gettimeofday;      my $now = gettimeofday;
472    
# Line 618  Line 644 
644                  {                  {
645                      $args = YAML::Load($arg_raw);                      $args = YAML::Load($arg_raw);
646                  }                  }
647                    elsif ($encoding eq 'application/yaml2')
648                    {
649                        $args = YAML::XS::Load($arg_raw);
650                    }
651                  else                  else
652                  {                  {
653                      $logger->logwarn("Invalid encoding $encoding");                      $logger->logwarn("Invalid encoding $encoding");
# Line 643  Line 673 
673              {              {
674                  $enc_res = YAML::Dump(@res);                  $enc_res = YAML::Dump(@res);
675              }              }
676                elsif ($encoding eq 'application/yaml2')
677                {
678                    $enc_res = YAML::XS::Dump(@res);
679                }
680          }          }
681          catch          catch
682          {          {

Legend:
Removed from v.1.85  
changed lines
  Added in v.1.86

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3