PHP Classes

File: src/Interfaces/GraphInterface.php

Recommend this page to a friend!
  Classes of Rodolfo Berrios Arce   Workflow   src/Interfaces/GraphInterface.php   Download  
File: src/Interfaces/GraphInterface.php
Role: Class source
Content type: text/plain
Description: Class source
Class: Workflow
Create and run action workflows
Author: By
Last change:
Date: 1 month ago
Size: 1,601 bytes
 

Contents

Class file image Download
<?php

/*
 * This file is part of Chevere.
 *
 * (c) Rodolfo Berrios <[email protected]>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

declare(strict_types=1);

namespace
Chevere\Workflow\Interfaces;

use
Chevere\DataStructure\Interfaces\StringMappedInterface;
use
Chevere\DataStructure\Interfaces\VectorInterface;

/**
 * Describes the component in charge of defining job execution order, where each node contains async jobs.
 *
 * @extends StringMappedInterface<VectorInterface<string>>
 */
interface GraphInterface extends StringMappedInterface
{
   
/**
     * Determines if the graph has the given `$job`.
     */
   
public function has(string $job): bool;

   
/**
     * Retrieve dependencies for the given `$job`.
     *
     * @return VectorInterface<string>
     */
   
public function get(string $job): VectorInterface;

   
/**
     * Determines if the given `$job` has the given `$dependencies`.
     */
   
public function hasDependencies(string $job, string ...$dependencies): bool;

   
/**
     * Return an instance with the specified `$name` and `$job` put.
     *
     * This method MUST retain the state of the current instance, and return
     * an instance that contains the specified `$name` and `$job` put.
     */
   
public function withPut(string $name, JobInterface $job): self;

   
/**
     * Returns the graph as an array of arrays, where each array is a node with async jobs.
     *
     * @return array<int, array<int, string>>
     */
   
public function toArray(): array;
}