Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Fix] - 2 watchers simultaneously #42

Open
Padam87 opened this issue Apr 14, 2014 · 12 comments
Open

[Fix] - 2 watchers simultaneously #42

Padam87 opened this issue Apr 14, 2014 · 12 comments

Comments

@Padam87
Copy link
Contributor

Padam87 commented Apr 14, 2014

Hi,

I've tried to use 2 watchers simultaneously, without much success. Is there any way to do this?

Thanks!

bldr:
    name: Test
    profiles:
        dev:
            description: Development
            tasks:
                - fosJSRouting
                - assetic
                - watch
    tasks:
        fosJSRouting:
            description: Dumps the routing
            calls:
                -
                    type: exec
                    failOnError: true
                    executable: php
                    arguments:
                        - app/console
                        - fos:js-routing:dump
        assetic:
            description: Dumps assets
            calls:
                -
                    type: exec
                    failOnError: true
                    executable: php
                    arguments:
                        - app/console
                        - assetic:dump
                        - --force
        watch:
            calls:
                -
                    type: watch
                    src:
                        - { path: [app/cache/dev], files: appDevUrlGenerator.php }
                    task: fosJSRouting
                -
                    type: watch
                    src:
                        - { path: web, files: [*.js, *.css, *.less], recursive: true }
                    task: assetic
@cryptiklemur
Copy link
Member

hmm... I could move the task and profile configs under the src arrays. Thoughts?

@cryptiklemur
Copy link
Member

Otherwise, right now, you could have two processes running.

@Padam87
Copy link
Contributor Author

Padam87 commented Apr 14, 2014

Just took a look at the Watch extension... that could be great. Another idea would be react, but the first is simpler :)

For now, I will use assetic with the built-in --watch param.

@cryptiklemur
Copy link
Member

Care to expand on React?

@Padam87
Copy link
Contributor Author

Padam87 commented Apr 14, 2014

https://github.com/reactphp/react/blob/master/examples/child-process.php

Watch tasks could be ran in a non-blocking way, like in the example above, and the main loop could terminate as soon as one of the children does (most likely because of an error)

@cryptiklemur
Copy link
Member

@Padam87
Copy link
Contributor Author

Padam87 commented Apr 14, 2014

I think so. I did not know that the process component can do this as well :)

@cryptiklemur
Copy link
Member

@Padam87 would you want to make a PR?

@Padam87
Copy link
Contributor Author

Padam87 commented Apr 14, 2014

I will try to implement it, but first I want to replace ant on my project.

@cryptiklemur
Copy link
Member

if you need help, feel free to add me on skype: aequasi

@cryptiklemur cryptiklemur changed the title 2 watchers simultaneously [Fix] - 2 watchers simultaneously Apr 16, 2014
@cryptiklemur
Copy link
Member

@Padam87 were you able to replace ant?

@cryptiklemur
Copy link
Member

@Padam87 bump?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants