call site 12 for execnet.PopenGateway.remote_exec
execnet/testing/test_gateway.py - line 258
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
   def test_channel_callback_stays_active(self, earlyfree=True):
       # with 'earlyfree==True', this tests the "sendonly" channel state.
       l = []
       channel = self.gw.remote_exec(source='''
               import thread, time
               def producer(subchannel):
                   for i in range(5):
                       time.sleep(0.15)
                       subchannel.send(i*100)
               channel2 = channel.receive()
               thread.start_new_thread(producer, (channel2,))
               del channel2
->             ''')
       subchannel = self.gw.newchannel()
       subchannel.setcallback(l.append)
       channel.send(subchannel)
       if earlyfree:
           subchannel = None
       counter = 100
       while len(l) < 5:
           if subchannel and subchannel.isclosed():
               break
           counter -= 1
           print counter
           if not counter:
               py.test.fail("timed out waiting for the answer[%d]" % len(l))
           time.sleep(0.04)   # busy-wait
       assert l == [0, 100, 200, 300, 400]
       return subchannel