{"action":"created","issue":{"url":"https://api.github.com/repos/uecode/qpush-bundle/issues/97","repository_url":"https://api.github.com/repos/uecode/qpush-bundle","labels_url":"https://api.github.com/repos/uecode/qpush-bundle/issues/97/labels{/name}","comments_url":"https://api.github.com/repos/uecode/qpush-bundle/issues/97/comments","events_url":"https://api.github.com/repos/uecode/qpush-bundle/issues/97/events","html_url":"https://github.com/uecode/qpush-bundle/issues/97","id":154525328,"number":97,"title":"Writing a Custom Provider","user":{"login":"talisman-innovations","id":15648551,"avatar_url":"https://avatars.githubusercontent.com/u/15648551?v=3","gravatar_id":"","url":"https://api.github.com/users/talisman-innovations","html_url":"https://github.com/talisman-innovations","followers_url":"https://api.github.com/users/talisman-innovations/followers","following_url":"https://api.github.com/users/talisman-innovations/following{/other_user}","gists_url":"https://api.github.com/users/talisman-innovations/gists{/gist_id}","starred_url":"https://api.github.com/users/talisman-innovations/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/talisman-innovations/subscriptions","organizations_url":"https://api.github.com/users/talisman-innovations/orgs","repos_url":"https://api.github.com/users/talisman-innovations/repos","events_url":"https://api.github.com/users/talisman-innovations/events{/privacy}","received_events_url":"https://api.github.com/users/talisman-innovations/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":7,"created_at":"2016-05-12T16:26:10Z","updated_at":"2016-06-30T08:24:39Z","closed_at":null,"body":"Hi\r\n\r\nI'm trying to write a custom provider which uses a DB via Doctrine to queue and persist the messages.  I've run some tests using the sync driver which works fine.  I've now implemented the beginning of the custom provider by implementing ProviderInterface.  However when I try to use the new custom queue I get the following message\r\n\r\nWarning: Missing argument 1 for AppBundle\\QPush\\DoctrineProvider::__construct(), called in /Users/sbrookes/Development/symfony/app/cache/dev/appDevDebugProjectContainer.php on line 1839 and defined\r\n\r\nAs if the customer provider isn't calling the constructor with any arguments.\r\nAny ideas or some working code that implements a custom provider I can work from?\r\n\r\nThanks\r\n\r\nSteve\r\n\r\nSection from config.yml\r\n\r\n> uecode_qpush:\r\n\r\n    providers:\r\n        in_band:\r\n            driver: sync\r\n        file_based:\r\n            driver: file\r\n            path: %kernel.root_dir%/tmp\r\n        custom_provider:\r\n            driver: custom\r\n            service: qpush.doctrine\r\n\r\n    queues:\r\n        tide_queue:\r\n            provider: file_based\r\n            options:\r\n              message_delay:          0\r\n              push_notifications:     true\r\n              messages_to_receive:    100\r\n        tide_queue1:\r\n            provider: custom_provider\r\n\r\n\r\nServices.yml\r\n\r\n> services:\r\n\r\n    qpush.doctrine:\r\n        class: AppBundle\\QPush\\DoctrineProvider\r\n\r\n\r\nDoctrineProvider.php\r\n\r\nnamespace AppBundle\\QPush;\r\n\r\nuse Doctrine\\Common\\Cache\\Cache;\r\nuse Symfony\\Bridge\\Monolog\\Logger;\r\nuse AppBundle\\Entity\\DoctrineMessage;\r\nuse Uecode\\Bundle\\QPushBundle\\Event\\MessageEvent;\r\nuse Uecode\\Bundle\\QPushBundle\\Message\\Message;\r\nuse Uecode\\Bundle\\QPushBundle\\Provider\\ProviderInterface;\r\n\r\nclass DoctrineProvider implements ProviderInterface {\r\n    protected $em;\r\n    \r\n    /**\r\n     * Constructor for Provider classes\r\n     *\r\n     * @param string $name    Name of the Queue the provider is for\r\n     * @param array  $options An array of configuration options for the Queue\r\n     * @param mixed  $client  A Queue Client for the provider\r\n     * @param Cache  $cache   An instance of Doctrine\\Common\\Cache\\Cache\r\n     * @param Logger $logger  An instance of Symfony\\Bridge\\Mongolog\\Logger\r\n     */\r\n    public function __construct($name, array $options, $client, Cache $cache, Logger $logger)\r\n    {\r\n        $this->name     = $name;\r\n        $this->options  = $options;\r\n        $this->cache    = $cache;\r\n        $this->logger   = $logger;\r\n        $this->em       = $this->getDoctrine()->getManager();\r\n    }\r\n\r\n Other functions still in development"},"comment":{"url":"https://api.github.com/repos/uecode/qpush-bundle/issues/comments/229594471","html_url":"https://github.com/uecode/qpush-bundle/issues/97#issuecomment-229594471","issue_url":"https://api.github.com/repos/uecode/qpush-bundle/issues/97","id":229594471,"user":{"login":"oad-dwarf","id":10807424,"avatar_url":"https://avatars.githubusercontent.com/u/10807424?v=3","gravatar_id":"","url":"https://api.github.com/users/oad-dwarf","html_url":"https://github.com/oad-dwarf","followers_url":"https://api.github.com/users/oad-dwarf/followers","following_url":"https://api.github.com/users/oad-dwarf/following{/other_user}","gists_url":"https://api.github.com/users/oad-dwarf/gists{/gist_id}","starred_url":"https://api.github.com/users/oad-dwarf/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/oad-dwarf/subscriptions","organizations_url":"https://api.github.com/users/oad-dwarf/orgs","repos_url":"https://api.github.com/users/oad-dwarf/repos","events_url":"https://api.github.com/users/oad-dwarf/events{/privacy}","received_events_url":"https://api.github.com/users/oad-dwarf/received_events","type":"User","site_admin":false},"created_at":"2016-06-30T08:24:39Z","updated_at":"2016-06-30T08:24:39Z","body":"I'd be very happy with your working solution as is and rework it as needed, since we're in a situation using the file provider and it backfiring on us due to filesystem rights. So I'd have to implement it myself anyway if I can't use yours. "}}
{"actor":{"display_login":"oad-dwarf"}}