Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Flow Laravel Package

darkwood/flow

Flow is a PHP 8.5+ package for building asynchronous pipelines with a functional style. Define steps with generators, pass typed data through each stage, and await execution. Includes examples and docs, with a focus on assembling code as “flows”.

View on GitHub
Deep Wiki
Context7

title: "Job" description: "Job." lead: "Job." date: 2020-10-13T15:21:01+02:00 lastmod: 2020-10-13T15:21:01+02:00 draft: false images: [] menu: docs: parent: "getting-started" weight: 10 toc: true

Job

When using Flow, you can pass Closure or JobInterface, it's useful when you want to specialize your Job, that come with dependency injection.

ClosureJob

ClosureJob simplifies job handling by allowing the use of closures or custom job classes, providing a versatile solution for managing jobs in your application.

YJob

The YJob class defines the Y combinator to recursively apply the job function, making it particularly useful in scenarios where you need to perform recursive tasks without explicitly writing recursive functions.

LambdaJob

The LambdaJob class provides a way to evaluate lambda calculus expressions in PHP. It implements the Flow\JobInterface and allows you to:

  • Parse and evaluate lambda expressions
  • Work with functional programming concepts directly in PHP
  • Transform lambda calculus notation into executable PHP code

Example usage:

<?php

$job = new LambdaJob('λx.x + 1');
$result = $job(5); // Returns 6

// Using with multiple parameters
$job = new LambdaJob('λx.λy.x + y');
$result = $job(5)(3); // Returns 8

The LambdaJob is particularly useful when you want to:

  • Express mathematical functions in lambda calculus notation
  • Work with pure functions in a functional programming style
  • Create composable function transformations

For more complex examples and detailed implementation, refer to the Lambda Interpreter article.

Make your own Job

You can make your custom Job by implementing Flow\JobInterface.

Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
terminal42/code-quality-tools
codifyo/ts-generator-bundle
testo/fiber
mintobit/jobqueue
a4sex/maintenance-bundle
a4sex/entity-date-update
a4sex/client-identifier
a4sex/base-utilites
a4sex/key-value-storage
a4sex/micro-status
chilldev/dependency-injection-extra
datinglibre/datinglibre-app-api
biberltd/corebundle
bricre/symfony-bundle-test
biberltd/logbundle
dominium/http-adapter-bundle
dominium/google-analytics
a4sex/auto-clean-entity
christhompsontldr/laravel-inky
spatie/mailcoach-vapor