title: How to define task in node-celery ?
body: <p>I am using <a href="https://www.npmjs.com/package/node-celery" rel="nofollow noreferrer">node-celery</a>.
  I just need to implement scheduling task so that Task can run on the background at the specific time.
  I am confused how can I define my task, currently I am defining task at the same file where I am implementing node-celery.</p>
  
  <pre><code>const celery = require('node-celery');
  let client = celery.createClient({
                  CELERY_BROKER_URL: 'amqp://guest:guest@localhost:5672//',
                  CELERY_RESULT_BACKEND: 'amqp://'
              });
  </code></pre>
  
  <p>In the above code, I just require node-celery and then created a client for amqp.
  Now I have to connect <strong>client</strong> and then call my task  <em><strong>send_batch_email_using_mailgun</strong></em> with some parameter. </p>
  
  <pre><code>client.on('connect', function() {
              client.call('send_batch_email_using_mailgun', {
                  campaign_data: campaign_data,
                  subject: subject,
                  template: template
              }, {
                  eta: new Date(Date.now() + 120000)
              });
          });
  </code></pre>
  
  <p>Here <em>_send_batch_email_using_mailgun_</em> is the task which is defined below the code in the same file with some parameter.
  I want that my function <strong>_send_batch_email_using_mailgun_</strong> should be called after a certain time. My code is not working I think I have to define my task function elsewhere but I don't know where to define them.
  Do I need to create my task in python file? If yes then how can I import them in my js file?</p>