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

Diff of /FigKernelPackages/FFserver.pm

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

revision 1.4, Fri May 8 17:08:14 2009 UTC revision 1.5, Mon May 11 20:55:05 2009 UTC
# Line 85  Line 85 
85    
86  sub assign_functions_to_dna  sub assign_functions_to_dna
87  {  {
88      my($self, $input) = @_;      my($self, $input, $min_hits, $max_gap) = @_;
89    
90      my $wq;      my $wq;
91    
# Line 98  Line 98 
98          $wq = FastaWorkQueue->new($input);          $wq = FastaWorkQueue->new($input);
99      }      }
100    
101      return ResultHandler->new($wq, $self->{server_url}, 'assign_functions_to_DNA', \&id_seq_pair_bundler, \&tab_delimited_output_parser);      return ResultHandler->new($wq, $self->{server_url}, 'assign_functions_to_DNA', \&id_seq_pair_bundler, \&tab_delimited_output_parser, [min_hits => $min_hits, max_gap => $max_gap]);
102  }  }
103    
104  sub id_seq_pair_bundler  sub id_seq_pair_bundler
# Line 132  Line 132 
132    
133  sub new  sub new
134  {  {
135      my($class, $work_queue, $server_url, $function, $input_bundler, $output_parser) = @_;      my($class, $work_queue, $server_url, $function, $input_bundler, $output_parser, $form_vars) = @_;
136    
137      my $self = {      my $self = {
138          work_queue => $work_queue,          work_queue => $work_queue,
# Line 142  Line 142 
142          output_parser => $output_parser,          output_parser => $output_parser,
143          ua => LWP::UserAgent->new(),          ua => LWP::UserAgent->new(),
144          cur_result => undef,          cur_result => undef,
145            form_vars => $form_vars ? $form_vars : [],
146      };      };
147      return bless $self, $class;      return bless $self, $class;
148  }  }
# Line 159  Line 160 
160          my @inp = $self->{work_queue}->get_next_n_bytes(16000);          my @inp = $self->{work_queue}->get_next_n_bytes(16000);
161          if (@inp)          if (@inp)
162          {          {
163              my $form = [function => $self->{function},              my $form = [@{$self->{form_vars}}];
164                          map { &{$self->{input_bundler}}($_) } @inp ];              push(@$form, function => $self->{function},
165              # print "Invoke " .Dumper($form);                           map { &{$self->{input_bundler}}($_) } @inp);
166                print "Invoke " .Dumper($form);
167    
168              my $res = $self->{ua}->post($self->{server_url}, $form);              my $res = $self->{ua}->post($self->{server_url}, $form);
169              if ($res->is_success)              if ($res->is_success)

Legend:
Removed from v.1.4  
changed lines
  Added in v.1.5

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3