Welcome to the Harris Geospatial product documentation center. Here you will find reference guides, help documents, and product libraries.


  >  Docs Center  >  IDL Reference  >  Asynchronous Jobs  >  IDLAsyncBridgeTaskJob

IDLAsyncBridgeTaskJob

IDLAsyncBridgeTaskJob

The IDLAsyncBridgeTaskJob class encapsulates the combined behaviors of its base classes IDLAsyncBridgeJob and IDLTaskJob. It allows the user to specify a single IDLTask that will be executed inside an IDL_IDLBridge when there are available resources. The IDLTask must have all of its input parameters specified before creating this job, as it will be cloned and dehydrated for passage to the bridge via IDL_IDLBridge::SetVar.

Superclasses


Examples


; Use S3 folder for a dataset covering Boulder, CO, taken April 4, 2017
folderUrl = 'https://s3-us-west-2.amazonaws.com/landsat-pds/L8/033/032/LC80330322017104LGN00'
; Dataset name is same as folder name, and is root of all files
datasetName = File_BaseName(folderUrl)
 
; List of suffixes to apply to dataset name for all files needed to
; comprise a full Landsat 8 dataset.  Band 8 is the panchromatic band,
; which is the largest, so start downloading it first.
suffixes = [ '_B8.TIF', $
             '_B1.TIF', $
             '_B2.TIF', $
             '_B3.TIF', $
             '_B4.TIF', $
             '_B5.TIF', $
             '_B6.TIF', $
             '_B7.TIF', $
             '_B9.TIF', $
             '_B10.TIF', $
             '_B11.TIF', $
             '_BQA.TIF', $
             '_MTL.txt' ]
 
; create a folder in the temp folder for the local files
localFolder = FilePath(datasetName, /TMP)
if (~File_Test(localFolder)) then File_MkDir, localFolder
 
; construct IDLAsyncJoin object to use for waiting on all jobs to complete
oJoin = IDLAsyncJoin()
; construct IDLAsyncQueue to manage parallel execution of jobs
oQueue = IDLAsyncQueue(CONCURRENCY=6)
; create object array to hold all jobs
jobs = ObjArr(N_Elements(suffixes))
; create task to be used by the jobs
task = IDLTask('Download_S3_URL')
 
; construct a unique job for each remote file to download
foreach suf, suffixes, i do begin
    ; update task parameters to current file suffix
    file = datasetName + suf
    task.S3_URL = folderUrl + '/' + file
    task.LOCAL_FILE = FilePath(file, ROOT=localFolder)
    ; construct IDLAsyncBridgeTaskJob that clones the task,
    ; passing in the join object
    jobs[i] = IDLAsyncBridgeTaskJob(task, JOIN=oJoin)
endforeach
 
tic
; submit all the jobs to the queue for execution
oQueue.SubmitJob, jobs
; wait for all jobs to be done
oJoin.WaitForJoin
toc

Syntax


Result = IDLAsyncBridgeTaskJob(Task [, INIT_COMMAND=String] [, JOIN=IDLAsyncJoin])

Arguments


Task

A scalar IDLTask object owned by this job, which will be executed inside an IDL_IDLBridge when Start is called.

Keywords


INIT_COMMAND (optional)

A scalar string of IDL code to be executed inside the bridge when it is initialized.

JOIN (optional)

An IDLAsyncJoin object that is passed to IDLAsyncJob base class Init() method for handling.

Methods


Properties


IDLAsyncBridgeTaskJob inherits all properties from IDLAsyncBridgeJob and IDLTaskJob.


IDLAsyncBridgeTaskJob::OnDone


The IDLAsyncBridgeTaskJob::OnDone method is an implementation override of IDLAsyncJob callback invoked on this job by the Done event handler. The basic sequence of operations follows:

  • Call GetReturnValue to get the dehydrated form of the executed task.
  • Rehydrate the task.
  • Call UpdateTask to store updated task.
  • Call IDLAsyncJob::OnDone.

Syntax


IDLAsyncBridgeTaskJob.OnDone

Arguments


None

Keywords


None

Version History


8.7

Introduced

See Also


IDLAsyncBridgeJob, IDLAsyncJob, IDLAsyncJoin, IDLTaskJob



© 2018 Harris Geospatial Solutions, Inc. |  Privacy Policy
My Account    |    Store    |    Contact Us