Reputation: 2139
I want to create a button in my application to call a task.
How can I do this with a link_to()
in my template for example ?
In routing.yml
it is possible to create a route to call the task ?
Upvotes: 0
Views: 37
Reputation: 22756
A task can't be launched from a web environment. The goal of a task is to run in command line. You can't achieve what you want to do like you want to do.
You should take a look at message queue soft for that:
In your case, your item will tell to the queue manager to launch a particular task.
There are a lot of differents message queue soft around ZeroMQ, Redis, Bernard, AMPQ, etc ..
But you can also built your own using a MySQL database (for example):
todo
(with an id, a flag, a task name, a field for parameters)todoTask
that will:
Upvotes: 2