diff options
author | Robin Appelman <icewind@owncloud.com> | 2015-02-17 16:49:14 +0100 |
---|---|---|
committer | Robin Appelman <icewind@owncloud.com> | 2015-02-25 15:08:40 +0100 |
commit | 74ae7b8929a7fd3f539fd15efb9533424114a480 (patch) | |
tree | 4388660851beff515a0ec78a2bea199c9a057fb2 /lib/private/command/callablejob.php | |
parent | f5b62267325415b307cf2d47b69d11d4337536e4 (diff) | |
download | nextcloud-server-74ae7b8929a7fd3f539fd15efb9533424114a480.tar.gz nextcloud-server-74ae7b8929a7fd3f539fd15efb9533424114a480.zip |
Add async command system to handle asynchronous operations
Diffstat (limited to 'lib/private/command/callablejob.php')
-rw-r--r-- | lib/private/command/callablejob.php | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/lib/private/command/callablejob.php b/lib/private/command/callablejob.php new file mode 100644 index 00000000000..6b755d615e6 --- /dev/null +++ b/lib/private/command/callablejob.php @@ -0,0 +1,22 @@ +<?php +/** + * Copyright (c) 2015 Robin Appelman <icewind@owncloud.com> + * This file is licensed under the Affero General Public License version 3 or + * later. + * See the COPYING-README file. + */ + +namespace OC\Command; + +use OC\BackgroundJob\QueuedJob; + +class CallableJob extends QueuedJob { + protected function run($serializedCallable) { + $callable = unserialize($serializedCallable); + if (is_callable($callable)) { + $callable(); + } else { + throw new \InvalidArgumentException('Invalid serialized callable'); + } + } +} |