2017 © Pedro Peláez
 

symfony-bundle async-service-call-bundle

Symfony bundle for asynchronous service methods calls

image

krlove/async-service-call-bundle

Symfony bundle for asynchronous service methods calls

  • Sunday, December 10, 2017
  • by krlove
  • Repository
  • 2 Watchers
  • 9 Stars
  • 3,072 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 1 Open issues
  • 5 Versions
  • 66 % Grown

The README.md

AsyncServiceCallBundle

This bundle allows you to execute methods of your services asynchronously in a background process, (*1)

Installation

Download using composer, (*2)

composer require krlove/async-service-call-bundle

Enable the bundle at AppKernel, (*3)

$bundles = [
   ...
   new Krlove\AsyncServiceCallBundle\KrloveAsyncServiceCallBundle(),
]

Configuration

Options:, (*4)

  • console_path - path to console script. Can be absolute or relative to kernel.root_dir parameter's value. Defaults to app/console for Symfony 2.* and bin/console for Symfony 3.*.
  • php_path - path to php executable. If no option provided in configuration, Symfony\Component\Process\PhpExecutableFinder::find will be used to set it up.

Example:, (*5)

# config.yml
krlove_async_service_call:
    console_path: bin/console
    php_path: /usr/local/bin/php

Usage

Define any service, (*6)

<?php

namespace AppBundle\Service;

class AwesomeService
{
    public function doSomething($int, $string, $array)
    {
        // do something heavy
        sleep(10)
    }
}

Register service, (*7)

# services.yml
services:
    app.service.awesome:
        class: AppBundle\Service\AwesomeService
        public: true

make sure your service is configured with public: true, (*8)

Execute doSomething method asynchronously:, (*9)

$this->get('krlove.async')
    ->call('app.service.awesome', 'doSomething', [1, 'string', ['array']);

Line above will execute AppBundle\Service\AwesomeService::doSomething method by running krlove:service:call command in asynchronous Symfony\Component\Process\Process., (*10)

Process PID will be returned on success, null on failure., (*11)

The Versions

10/12 2017

dev-master

9999999-dev

Symfony bundle for asynchronous service methods calls

  Sources   Download

MIT

The Requires

 

by Avatar krlove

service command symfony async

10/12 2017

1.0.5

1.0.5.0

Symfony bundle for asynchronous service methods calls

  Sources   Download

MIT

The Requires

 

by Avatar krlove

service command symfony async

04/12 2017

1.0.4

1.0.4.0

Symfony bundle for asynchronous service methods calls

  Sources   Download

MIT

The Requires

 

by Avatar krlove

service command symfony async

29/11 2017

1.0.1

1.0.1.0

Symfony bundle for asynchronous service methods calls

  Sources   Download

MIT

The Requires

 

by Avatar krlove

service command symfony async

29/11 2017

1.0.0

1.0.0.0

Symfony bundle for asynchronous service methods calls

  Sources   Download

MIT

The Requires

 

by Avatar krlove

service command symfony async