How to deal with dynamic JSON data using AngularJS?

What are the ways to pass a variable say an array or JSON data from client to worker using gearman?

  • I have a gearman client in PHP which creates a task. The gearman worker in python grabs that task and tries to complete it. I want my client to pass an array or any other variable data to the worker. How do I do that?

  • Answer:

    Found the solution myself. client - php : $client = new GearmanClient(); $client -> addServer(); $array = ('id' => 1, 'name' => 'abc); $task = $client->addTask('task', json_encode($array)); worker - python : def echoer(self, worker, job): data = json.loads(job.data) print job.data['id'], job.data('name') worker = Worker('localhost', '4730') # assume Worker is a class in which echoer is defined worker.registerTask('task', worker.echoer)# registerTask is defined in Worker class worker.work() # work is defined in Worker class

Hussain Tamboli at Quora Visit the source

Was this solution helpful to you?

Related Q & A:

Just Added Q & A:

Find solution

For every problem there is a solution! Proved by Solucija.

  • Got an issue and looking for advice?

  • Ask Solucija to search every corner of the Web for help.

  • Get workable solutions and helpful tips in a moment.

Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.