Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Almost, but not exactly. <code>cooperate</code> is a slightly newer API than <code>coiterate</code>. <code>cooperate</code> is generally just a slightly better version of <code>coiterate</code> and you pretty much always want to use it. Returning a <code>CooperativeTask</code> confers two benefits. First, you can <a href="http://twistedmatrix.com/documents/current/api/twisted.internet.task.CooperativeTask.html#pause">pause</a> and <a href="http://twistedmatrix.com/documents/current/api/twisted.internet.task.CooperativeTask.html#resume">resume</a> the task without <a href="http://twistedmatrix.com/documents/current/api/twisted.internet.task.CooperativeTask.html#stop">stopping</a> it, and second, you can generate <a href="http://twistedmatrix.com/documents/current/api/twisted.internet.task.CooperativeTask.html#whenDone">multiple Deferreds</a> that notify you of when the task is done without interfering with each other, rather than just the one.</p> <p>Both <code>coiterate</code> and <code>cooperate</code> produce a <code>CooperativeTask</code> under the hood, and both use a very short interval <code>LoopingCall</code> as their default scheduler. If you want to use a different task scheduler you can always instantiate your own <a href="http://twistedmatrix.com/documents/current/api/twisted.internet.task.Cooperator.html"><code>Cooperator</code></a>.</p> <p>(By the way, if there's no doc bug yet for the fact that <code>coiterate</code> returns a <code>Deferred</code>, please file one.)</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload