Comments (14)
I could be very cool !
from leezypheanstalkbundle.
I'm facing the problem that there is no way to get the collection of connection. I'll try to make it work with the default connection but it's something that we should look into.
Is there any reason this has not been implemented and that you are using the connection finder in your commands?
from leezypheanstalkbundle.
I've just added a new ConnectionLocator to replace ConnectionFinder : 7d71b79
$pheanstalkConnectionLocator = $this->get("leezy.pheanstalk.connection_locator");
$pheanstalkConnectionLocator->getConnections();
from leezypheanstalkbundle.
thanks,
I've started implementing it. It looks quite simple except that I have problem setting up the DataCollector service to the profiler.
If I configure the service in the service.xml I can't inject leezy.pheanstalk.connection_locator
in it because it's not yet defined. So I've tried to setup the service using DependencyInjection\Definition
like you are doing for your ConnectionLocator
. Everything looks fine, if I dump the argument in the DataCollector
I have an instance of Leezy\PheanstalkBundle\ConnectionLocator
which is correct.
However later on, when the profiler is loading it appears that this object disappears :|
I really don't know why at the moment. I'll try to look into it later today.
In the mean time I've created a new branch Profiler
in my forked repo if anyone wants to have a look.
Here is the DependencyInjection Extension: https://github.com/Maxwell2022/LeezyPheanstalkBundle/blob/profiler/DependencyInjection/LeezyPheanstalkExtension.php
from leezypheanstalkbundle.
@Maxwell2022, you can inject leezy.pheanstalk.connection_locator
on any service defined in service.xml. There is no need to defined it manually with Definition
.
Regards,
from leezypheanstalkbundle.
If I do it I have the following error:
RuntimeException: The definition for "4a9b71937182c71843f6b77fdd9f3923_1"
has no class. If you intend to inject this service dynamically at runtime, please
mark it as synthetic=true. If this is an abstract definition solely used by child
definitions, please add abstract=true, otherwise specify a class to get rid of this
error.
<?xml version="1.0" ?>
<container xmlns="http://symfony.com/schema/dic/services"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd">
<services>
<service id="leezy.data_collector.pheanstalk" class="Leezy\PheanstalkBundle\Profiler\DataCollector\PheanstalkDataCollector">
<argument type="service">leezy.pheanstalk.connection_locator</argument>
<tag id="pheanstalk" template="LeezyPheanstalkBundle:Profiler:pheanstalk" name="data_collector"></tag>
</service>
</services>
</container>
Also if I try to access the service I've setup in a controller, ti's working perfectly:
$dataCollector = $this->get('leezy.data_collector.pheanstalk');
$c = $dataCollector->getConnections();
var_dump($c);
die;
I've spent few hours trying to debug it but could not find anything. I've looked into the scope
trying to change it but I could not. I'm really stuck here.
from leezypheanstalkbundle.
You have made a mistake.
Try this :
<?xml version="1.0" ?>
<container xmlns="http://symfony.com/schema/dic/services"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd">
<services>
<service id="leezy.data_collector.pheanstalk" class="Leezy\PheanstalkBundle\Profiler\DataCollector\PheanstalkDataCollector">
<argument type="service" id="leezy.pheanstalk.connection_locator" />
<tag id="pheanstalk" template="LeezyPheanstalkBundle:Profiler:pheanstalk" name="data_collector" />
</service>
</services>
</container>
from leezypheanstalkbundle.
so now there is no more exceptions but I have the same problem than before. The connection_locator
is null. No idea what's happening.
from leezypheanstalkbundle.
I think the data collector has be be trigger somehow otherwise it's returning nothing. I'm investigating.
from leezypheanstalkbundle.
Ok, I finally found it. It's because the DataCollector
is serialised after each request so the object is losing its dependencies. See in the profiler how it's collecting the data.
I've done a simple test and it looks awesome, can't wait to have it work :)
from leezypheanstalkbundle.
Can you make a Pull Request when ready ;)
from leezypheanstalkbundle.
Sure! Maybe tomorrow (Sydney time)
from leezypheanstalkbundle.
I've been faster than expected. Have a look and let me know but I think it's really cool ;)
Actually there is few things that I want to add / update:
- enable / disable the profiler from the config
- move the
jobs
table at the top of the Profilerpanel
- display empty message when no
jobs
ready - ...
from leezypheanstalkbundle.
Done
from leezypheanstalkbundle.
Related Issues (20)
- Installation failed for ~3.0 HOT 1
- Docs? Practical example? HOT 1
- LeezyPheanstalkBundle for Silex HOT 3
- Compatible sf 3.0 ? HOT 2
- Throw an exception when PheanstalkLocator finds no instances. HOT 1
- thows a missing argument exception when running on symfony 2.3 HOT 3
- Wrong proxy instance inserted HOT 2
- Calling primary connection "default" cause weird behaviour HOT 4
- Post PUT e RESERVE event HOT 2
- Suggestion for documantation HOT 1
- Twig 2 support HOT 4
- Tag new release? HOT 2
- Symfony 3.4 DataCollectorInterface must implement reset() HOT 1
- Make commands and services public HOT 2
- Some troubles with Symfony Profiler HOT 4
- Support Pheanstalk 4 HOT 2
- Tree builder without a root node deprecation
- Missing something after requiring package? im using symfony 4
- Container linting fails because of leezy.pheanstalk.proxy.default service definition
- Symfony 5 compatibility HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from leezypheanstalkbundle.