[ Index ]

PHP Cross Reference of Joomla 4.2.2 documentation

title

Body

[close]

/plugins/task/demotasks/src/Extension/ -> DemoTasks.php (summary)

(no description)

Copyright: (C) 2021 Open Source Matters, Inc.
License: GNU General Public License version 2 or later; see LICENSE.txt
File Size: 223 lines (7 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 6 functions

  getSubscribedEvents()
  resumable()
  sleep()
  stressMemory()
  stressMemoryRemoveLimit()
  getMemoryLimit()

Functions
Functions that are not part of a class:

getSubscribedEvents()   X-Ref

return: string[]

resumable(ExecuteTaskEvent $event)   X-Ref
Sample resumable task.

Whether the task will resume is random. There's a 40% chance of finishing every time it runs.

You can use this as a template to create long running tasks which can detect an impending
timeout condition, return Status::WILL_RESUME and resume execution next time they are called.

param: ExecuteTaskEvent  $event  The event we are handling
return: integer

sleep(ExecuteTaskEvent $event)   X-Ref

param: ExecuteTaskEvent  $event  The `onExecuteTask` event.
return: integer  The routine exit code.

stressMemory(ExecuteTaskEvent $event)   X-Ref
Standard routine method for the memory test routine.

param: ExecuteTaskEvent  $event  The `onExecuteTask` event.
return: integer  The routine exit code.

stressMemoryRemoveLimit(ExecuteTaskEvent $event)   X-Ref
Standard routine method for the memory test routine, also attempts to override the memory limit set by the PHP
INI.

param: ExecuteTaskEvent  $event  The `onExecuteTask` event.
return: integer  The routine exit code.

getMemoryLimit()   X-Ref
Processes the PHP ini memory_limit setting, returning the memory limit in KB

return: float



Generated: Wed Sep 7 05:41:13 2022 Chilli.vc Blog - For Webmaster,Blog-Writer,System Admin and Domainer