Giter VIP home page Giter VIP logo

relay's People

Contributors

vovayatsyuk avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

relay's Issues

1.0.0

I'd like to change the API to be closer to Laravel's Batch API, and add additional features:

  • Use then and finally methods (currently you cannot use finally)
  • Allow setting different names for each of the batches
  • Allow filtering batches by metadata
  • Get correct progress

New version of that one that's used in the readme:

Relay::batch([
        [
            new DownloadSources($project),
            new DetectSettings($project),
        ]
    ])
    ->then([
        new ReadStringFiles($project),
        new ReadSourceFiles($project),
    ])
    ->then([
        new IgnoreKnownStrings($project),
        new RemoveSources($project),
    ])
    ->name('Update Project') //  [:current/:total] will be added automatically
    ->dispatch();

Different names, metadata

Relay::batch('Downloading Sources', [
        [
            new DownloadSources($project),
            new DetectSettings($project),
        ]
    ])
    ->then('Processing Files', [
        new ReadStringFiles($project),
        new ReadSourceFiles($project),
    ])
    ->then('Cleanup', [
        new IgnoreKnownStrings($project),
        new RemoveSources($project),
    ])
    ->meta([
        'project.update' => $project->id,
        'causer' => $user->id
    ])
    ->dispatch();

Find job batches

Relay::whereMeta('project', 5)->whereMeta('causer', 1)->first();
Relay::whereMeta('project.update')->all(); // get all project.update job batches
Relay::whereMeta('project.update', 5)->all(); // get project.update batches for project_id=5
Relay::whereMeta('causer', 1)->all(); // get all batches started by user_id=1

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.