title: Scrapy and celery `update_state`
body: <p>I have the following setup (Docker):</p>
  
  <ul>
  <li>Celery linked to Flask setup which runs the Scrapy spider</li>
  <li>Flask setup (obviously)</li>
  <li>Flask setup gets request for Scrapy -> fire up worker to do some work</li>
  </ul>
  
  <p>Now I wish to update the original flask setup on the progress of the celery worker. <em>BUT</em> there is no way right now to use <code>celery.update_state()</code> inside of the scraper as it has no access to the original task (though it is being run inside of the celery task).</p>
  
  <p>As an aside: am i missing something about the structure of scrapy? It would seem reasonable that I can assign arguments inside of <code>__init__</code> to be able to use furtheron, but scrapy uses the method as lambda functions it seems..</p>
  
  <hr>
  
  <p>To answer some questions:</p>
  
  <ul>
  <li><code>How are you using celery with scrapy?</code> Scrapy is running inside of a celery task, not run from the command line. I also have never heard of <code>scrapyd</code>, is this a subproject of scrapy? I use a remote worker to fire off scrapy from inside of a celery/flask instance, so it is not the same as the thread being intanced by the original request, they are seperate docker instances.</li>
  </ul>
  
  <p>The <code>task.update_state</code> works great! inside of the celery task, but as soon as we are 'in' the spider, we no longer have access to celery. Any ideas?</p>
  
  <blockquote>
    <p>From the item_scraped signal issue Task.update_state(taskid,meta={}). You can also run without the taskid if scrapy happens to be running in a Celery task itself (as it defaults to self)</p>
  </blockquote>
  
  <p>Is this sort of like a static way of accessing the current celery task? As I would love that....</p>