Download the PHP package tempcord/tasks without Composer

On this page you can find all versions of the php package tempcord/tasks. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package tasks

Tempcord Tasks

Scheduled tasks for the Tempcord Discord bot framework: work the bot does on a timer rather than in reply to anything — sweeping rows that have run their course, lifting blocks that have expired, polling a service with no gateway event of its own.

Installation

Declaring a task

On the class, the way every other Tempcord handler is declared:

Or on a method, when several chores belong together and would only be split across classes to satisfy the attribute:

That is the whole registration. Tasks are discovered like commands and listeners, are built by the container so they may take whatever dependencies they need, and are put on the event loop before the gateway opens.

What the plugin guarantees

A timer is less forgiving than an event listener: it fires again whether or not the last turn finished or threw, forever. Three things are handled so you do not write them into every task.

An ordinary turn is logged at debug rather than info: a task running every ten seconds would otherwise write eight thousand lines a day saying nothing happened.

Options

A task with neither an interval nor a cron expression, with both, or with an interval under a second is refused while the bot is starting rather than at the moment it would have run. So is a cron expression that cannot be read.

Left unnamed, a task is called after its class — SweepTemporaryMessages — or after the class and method for a method-level task — Housekeeping::sweepMessages. The class is part of it because two classes may well have a sweep(), and tasks sharing a name would share their statistics and could not be cancelled apart.

The first turn

The first turn comes after the interval unless runOnBoot says otherwise. A task is a repeating chore; one-off startup work — reconciling against whatever changed while the bot was down — usually belongs in a plugin's boot(), where its ordering against everything else is visible.

Cron expressions

Standard five-field format:

Wildcards (*), lists (1,15,30), ranges (9-17) and steps (*/5, 1-10/2) are supported. A step over a range counts from where the range starts, so 1-10/2 is 1,3,5,7,9.

Aliases: @yearly / @annually, @monthly, @weekly, @daily / @midnight, @hourly.

Both day fields restricted means either. 0 0 1 * 1 runs on the first of the month and on every Monday, which is what cron does and what anyone writing it expects. When only one of the two names particular days, it simply narrows.

A cron task is armed one turn at a time, for the exact wait until the next matching minute, and re-armed from the turn just taken. Waking every minute to ask whether it is time yet drifts, and once the drift crosses a minute boundary a matching minute is stepped over and the task silently does not run that hour.

Console

Lists every registered task with its schedule and where it is declared.

Reaching the schedule at runtime

Registry is injectable, and is the better way in anything the container builds.

Requirements

License

MIT


All versions of tasks with dependencies

PHP Build Version
Package Version
Requires php Version ^8.5
tempcord/framework Version >=0.10 <2.0
react/event-loop Version ^1.3
react/async Version ^4.0
tempest/console Version ^3.18
tempest/core Version ^3.18
tempest/log Version ^3.18
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package tempcord/tasks contains the following files

Loading the files please wait ...