GithubHelp home page GithubHelp logo

Comments (11)

Mulkave avatar Mulkave commented on June 16, 2024

What version of Laravel are you using ?

from minion.

Mulkave avatar Mulkave commented on June 16, 2024

Ah, I see from your structure it seems to be Laravel 4. can you please use the following in your composer.json:

{
   "vinelab/minion": "1.2"
}

then perform a composer update and try again.

from minion.

arjundas avatar arjundas commented on June 16, 2024

NO, its not work, :(,

I am using modular structure in Laravel, Can it affect this?

I am using creolab/laravel-modules for Modularization in laravel.

from minion.

Mulkave avatar Mulkave commented on June 16, 2024

It shouldn't matter what structure you use, as long as your provider is extending Vinelab\Minion\Provider it should work.

If you are running minion using artisan make sure you tell minion about your ChatProvider class with the register option:

php artisan minion:run --register="ChatProvider"

from minion.

arjundas avatar arjundas commented on June 16, 2024

I tried this also but it still not working.

from minion.

Mulkave avatar Mulkave commented on June 16, 2024

seems like Minion is detecting the wrong ChatProvider class

from minion.

ChaosPower avatar ChaosPower commented on June 16, 2024

@arjundas I replied to your stackoverflow. @Mulkave is right, it is detecting a different ChatProvider class. Make sure Laravel is loading providers folder or you can't just use ChatProvider directly. You need to specify proper namespacing. PSR-0 standard.

namespace Providers\ChatProvider;

then you register ChatProvider like this --register"Providers\ChatProvider" you need to specify composer what to autoload.

Minion and Laravel are loading differently. That's why you need to specify a namespace.

from minion.

prbaron avatar prbaron commented on June 16, 2024

Just got the same error.
I am using Laravel 4. Here is my folder configuration :

app
    + Arato
        + push
            - AlertProvider.php
    + commands
    + config
    + controllers

in my composer.json :

"autoload": {
    "classmap": [
        ...
        "app/Arato"
    ]
}

the minion.php :

<?php

return [

    /*
    |--------------------------------------------------------------------------
    | Router Realm
    |--------------------------------------------------------------------------
    |
    | The realm that the router should use.
    |
    */
    'realm'     => 'minion',

    /*
    |--------------------------------------------------------------------------
    | Router Host
    |--------------------------------------------------------------------------
    |
    | The IP or hostname that the router should run under.
    |
    */
    'host'      => '127.0.0.1',

    /*
    |--------------------------------------------------------------------------
    | Router Port
    |--------------------------------------------------------------------------
    |
    | The port that should be used by the router.
    |
    */
    'port'      => 9090,

    /*
    |--------------------------------------------------------------------------
    | Auto-registered Providers
    |--------------------------------------------------------------------------
    |
    | The providers listed here will be automatically registered on the
    | session start of the router, in return their role is to register RPCs,
    | subscribe and publish to topics and pretty much whatever an Internal Client does.
    |
    */
    'providers' => [
        "Arato\push\AlertProvider"
    ],

    'debug'     => true,

];

the AlertProvider.php file :

<?php
namespace Arato\push;

use Vinelab\Minion\Provider;

class AlertProvider extends Provider
{
    public function boot()
    {
        $this->publish('i.am.here', ['name' => 'mr.minion']);
    }
}

I do not know why the namespace is incorrect.

Best regards.

from minion.

Mulkave avatar Mulkave commented on June 16, 2024

The problem is a namespace problem, you are classmapping in composer instead of autoloading with PSR, try:

"autoload": {
   " ...",
   "psr-0": {
       "Arato": "app/"
    }
}

And as a standard convention, try uppercasing the push folder, namespace and provider such as:

namespace Arato\Push;

from minion.

prbaron avatar prbaron commented on June 16, 2024

Thank you, I think it should be fixed now.

However I still have a problem, when I run php artisan minion:run with debug to true, I get the following :

2015-03-16T21:16:44.3259470 info       [Thruway\Transport\PawlTransportProvider 7393] Starting Transport
2015-03-16T21:16:44.3288680 info       [Thruway\Transport\PawlTransportProvider 7393] Pawl has connected
2015-03-16T21:16:44.3311980 debug      [Thruway\Transport\PawlTransportProvider 7393] Received: [2,356050420,{"roles":{"broker":{"features":{"publisher_exclusion":true,"subscriber_blackwhite_listing":true,"subscription_meta_api":true,"pattern_based_subscription":true,"publisher_identification":true}},"dealer":{"features":{"progressive_call_results":true,"shared_registration":true,"registration_meta_api":true,"pattern_based_registration":true,"caller_identification":true}}},"authid":"oJp4lmZNL5TWfnh2ADMzOO7K","authrole":"anonymous","authmethod":"anonymous"}]
2015-03-16T21:16:44.3313030 debug      [Vinelab\Minion\Client 7393] Client onMessage: [Thruway\Message\WelcomeMessage]
2015-03-16T21:16:44.3313290 info       [Vinelab\Minion\Client 7393] We have been welcomed...
2015-03-16T21:16:44.3327700 info       [Thruway\Transport\PawlTransportProvider 7393] Pawl has closed
2015-03-16T21:16:45.8362700 info       [Thruway\Transport\PawlTransportProvider 7393] Starting Transport
2015-03-16T21:16:45.8389650 info       [Thruway\Transport\PawlTransportProvider 7393] Pawl has connected
2015-03-16T21:16:45.8412010 debug      [Thruway\Transport\PawlTransportProvider 7393] Received: [2,1628429246,{"roles":{"broker":{"features":{"publisher_exclusion":true,"subscriber_blackwhite_listing":true,"subscription_meta_api":true,"pattern_based_subscription":true,"publisher_identification":true}},"dealer":{"features":{"progressive_call_results":true,"shared_registration":true,"registration_meta_api":true,"pattern_based_registration":true,"caller_identification":true}}},"authid":"o67hOrx3oruFbO62ecd1o567","authrole":"anonymous","authmethod":"anonymous"}]
2015-03-16T21:16:45.8413230 debug      [Vinelab\Minion\Client 7393] Client onMessage: [Thruway\Message\WelcomeMessage]
2015-03-16T21:16:45.8413510 info       [Vinelab\Minion\Client 7393] We have been welcomed...
2015-03-16T21:16:45.8430050 info       [Thruway\Transport\PawlTransportProvider 7393] Pawl has closed

and it is looping.

EDIT : seems this behavior comes from $this->publish('i.am.here', ['name' => 'mr.minion']);
EDIT 2 :

it should be

$this->publish('i.am.here', [], ['name' => 'mr.minion']);

from minion.

Mulkave avatar Mulkave commented on June 16, 2024

@prbaron exactly! It is publish($topic, $args, $kwArgs) where $args is an array of arguments and $kwArgs is the key-value array. Glad you had it resolved.

from minion.

Related Issues (14)

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.