Skip to content

Checklist For Speed

scil edited this page Sep 15, 2018 · 33 revisions
  • put Third_Party/ServiceProvider::class => [], in 'providers_on_worker' in config/laravelfly.php
  • find out singleton services in that service provider, and decide to make the services to be CLONE SERVICE or WORKER SERVICE (former is simpler).

CLONE SERVICE

  • put Third_Party/ServiceProvider::class => [ 'service_name' => 'clone', ],

  • If its Facade alias maybe used before any requests, put it in 'clean_Facade_on_work' in config/laravelfly.php

  • If other CLONE SERVICEs or WORKER SERVVCEs have ref to this service, update the ref in update_on_request in config/laravelfly.php.

    • By default, amoung Laravel offical services, only app('url') is cloned. If you CLONE SERVICE has an ref to app('url'), you have to update it.
  • There is no ref to this service in your controllers, see controller and stale reference.

  • If the service has an ref to app('request'), like (mcamara/laravel-localization it should be updated like this

    'update_on_request' => [

        [
            'this' => 'laravellocalization',
            'closure' => function () {
                app()->rebinding('request', function () {
                    $this->request = app('request');
                });
            }
        ],

    ],

WORKER SERVICE

  • ensure the service can be WORKER SERVICE, read WORKER SERVICE and WORKER OBJECT. If refactor by extending 3rd party service provider, replace third-party service provider with new service provider.

  • put Third_Party/ServiceProvider::class => [ 'service_name' => true, ],

CLONE SERVICE or WORKER SERVICE/OBJECT

  • If it has ref to other CLONE SERVICEs like app('routes'), update the ref in update_on_request in config/laravelfly.php
  • If it has ref to app('request'), update the ref in update_on_request in config/laravelfly.php