Skip to content

Instantly share code, notes, and snippets.

@apinstein
Created March 12, 2014 20:31
Show Gist options
  • Save apinstein/9515695 to your computer and use it in GitHub Desktop.
Save apinstein/9515695 to your computer and use it in GitHub Desktop.
$sc = ShellCommand::create()
->addCommand("echo HI")
;
$j = new RemoteShellCommandJob($sc);
$j->webhookThen(
array('MyPromiseHandler', 'success'),
array('MyPromiseHandler', 'error'),
array('MyPromiseHandler', 'notify')
);
$q = VirtualTourApp::getJQStore();
$q->enqueue($j, array('queueName' => 'foo'));
// => the enqueueing code exits here, UX say "Queued for processing..."
// NOW, some out-of-band process handles the request (local or remote worker for instance),
// and when it's done, the remote system will ping/webhook a generic webhook endpoint
// which will resolve/reject/progress the promise associated with this job...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment