Writing to a File using App Engine Deferred
<p>I have a task that I would like to kick off using App Engine's cron job scheduler. To build the handler for this task, I've been looking off of an <a href="https://cloud.google.com/appengine/articles/update_schema" rel="nofollow">App Engine article</a> that describes how to use a <code>deferred</code> to ensure that long-running tasks don't time out. </p>

<p>Note that this article talks about deferreds in the context of updating model entities. However, I would like to use it to continuously write to a file that will be hosted on Google Cloud Storage (GCS). </p>

<p>To compensate, I had thought to pass the the file stream that I am working with instead of the <code>Cursor</code> object as they do in the <code>UpdateSchema</code> definition in the article. However, in production (with 10k+ entries to write), I imagine that this file/file stream will be too big to pass around.</p>

<p>As such, I'm wondering if it would just be a better idea to write a portion of the file, save it to GCS, and then retrieve it when the deffered runs again, write to it, save it, etc -- or do something else entirely. I'm not quite sure what is typically done to accomplish App Engine tasks like this (i.e., where the input location is the datastore, but the output location is somewhere else).</p>

<p><strong>Edit</strong>: if it makes a difference, I'm using Python</p>