Class | Bio::DDBJ::REST::RequestManager
In: | lib/bio/io/ddbjrest.rb
Parent: | WABItemplate

### Description

DDBJ (DNA DataBank of Japan) special web service to get result of asynchronous web service. See below for details and examples.

- xml.nig.ac.jp/wabi/Method?serviceName=RequestManager&mode=methodList&lang=en

### Methods

getAsyncResult wait_getAsyncResult wait_getAsyncResult

### Public Class methods

wait_getAsyncResult(requestId)

the same as Bio::DDBJ::REST::RequestManager#wait_getAsyncResult

[Source]

         # File lib/bio/io/ddbjrest.rb, line 334
    334:       def self.wait_getAsyncResult(requestId)
    335:         self.new.wait_getAsyncResult(requestId)
    336:       end

### Public Instance methods

getAsyncResult(requestId)

see xml.nig.ac.jp/wabi/Method?&lang=en&serviceName=RequestManager&methodName=getAsyncResult&mode=methodDetail

[Source]

         # File lib/bio/io/ddbjrest.rb, line 299
    299:       def getAsyncResult(requestId); end

wait_getAsyncResult(requestId)

Waits until the query is finished and the result is returnd, with calling getAsyncResult.

This is BioRuby original method.

Arguments:

- (required) requestID: (String) requestId

Returns: | (String) result

[Source]

         # File lib/bio/io/ddbjrest.rb, line 310
    310:       def wait_getAsyncResult(requestId)
    311:         sleeptime = 2
    312:         while true
    313:           result = getAsyncResult(requestId)
    314:           case result.to_s
    315:           when /The search and analysis service by WWW is very busy now/
    316:             raise result.to_s.strip + '(Alternatively, wrong options may be given.)'
    317:           when /\AYour job has not (?:been )?completed yet/
    318:             sleeptime = 2 + rand(4)
    319:           when /\AERROR:/
    320:             raise result.to_s.strip
    321:           else
    322:             return result
    323:           end #case
    324:           if $VERBOSE then
    325:             $stderr.puts "DDBJ REST: requestId: #{requestId} -- waitng #{sleeptime} sec."
    326:           end
    327:           sleep(sleeptime)
    328:         end
    329:         # will never be reached here
    330:         raise "Bug?"
    331:       end

[Validate]