Icon

This is the documentation for an older version of Qube. The latest version of the documentation can be found here: Qube

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
titleUsing the "qube" callback language
linenumberstrue
languagepython
frameRange = '1-10'
 
jobA = {
	'name': 'my ribgen job',
	'label': 'ribgenLabel',
	'prototype': 'cmdline',
	'package': {
		'cmdline': 'my ribgen command...'
	},
	'agenda': qb.genframes(frameRange),
}

jobB = {
	'name': 'my render job',
	'label': 'render',
	'status': 'blocked',
	'prototype': 'cmdline',
	'package': {
		'cmdline': 'my render command...'
	},
	'agenda': qb.genframes(frameRange),
}

callbacks = [
	{ 
		'triggers': 'complete-job-ribgenLabel',
		'language': 'qube',
		'code': 'unblock-self'
	}
]

jobB['callbacks'] = callbacks
 
qb.submit( [jobA, jobB] )
Code Block
titleUsing the "python" callback language is identical to the first example, except the callback's "language" and "code" is different
linenumberstrue
languagepython
jobA = {
	.
	.
	.
}
 
jobB = {
	.
	.
	.
}
 
cbCode = 'jobId = qb.jobid()\n'
cbCode += 'qb.unblock(jobId)\n'

callbacks = [
	{ 
		'triggers': 'complete-job-ribgenLabel',
		'language': 'python',
		'code': cbCode
}
jobB['callbacks'] = callbacks
 
qb.submit( [jobA, jobB] )

 

Each frame in JobB waits for the its corresponding frame in jobA to complete

Code Block
titleUsing the "qube" callback language
linenumberstrue
languagepython
frameRange = '1-10'
 
jobA = {
	'name': 'my ribgen job',
	'label': 'ribgenLabel',
	'prototype': 'cmdline',
	'package': {
		'cmdline': 'my ribgen command...'
	},
	'agenda': qb.genframes(frameRange),
}

jobB = {
	'name': 'my render job',
	'label': 'render',
	'status': 'blocked',
	'prototype': 'cmdline',
	'package': {
		'cmdline': 'my render command...'
	},
	'agenda': qb.genframes(frameRange),
}

callbacks = []
for work in jobB['agenda']:
	work['status'] = 'blocked',
	
	callbacks.append(
		{ 
			'triggers': 'complete-jobwork-ribgenLabel',
			'language': 'qube',
			'code': 'unblock-work-self',
		}
	)
]
jobB['callbacks'] = callbacks
 
qb.submit( [jobA, jobB] )
Code Block
titleUsing the "python" callback language is identical to the first example, except the callback's "language" and "code" is different
linenumberstrue
languagepython
jobA = {
	.
	.
	.
}
 
jobB = {
	.
	.
	.
}
 
callbacks = []
for work in jobB['agenda']:
	work['status'] = 'blocked',
	frameNumber = work['name']


    # the agenda item's callback should unblock both itself and the job
    cbCode = 'jobId = qb.jobid()\n'
    cbCode += 'qb.workunblock("%%s:%s" %% jobId)\n' % frameNumber
    cbCode += 'qb.unblock(jobId)\n'

	callbacks.append(
		{ 
			'triggers': 'complete-work-ribgenLabel',
			'language': 'python',
			'code': cbCode,
		}
	)
]

jobB['callbacks'] = callbacks
 
qb.submit( [jobA, jobB] )