Questions tagged [twisted.internet]

Twisted Internet: Asynchronous I/O and Events.

Twisted Internet is a collection of compatible event-loops for . It contains the code to dispatch events to interested observers and a portable API so that observers need not care about which event loop is running. Thus, it is possible to use the same code for different loops, from Twisted's basic, yet portable, select-based loop to the loops of various GUI toolkits like GTK+ or Tk.

Project and documentation: http://twistedmatrix.com/documents/current/api/twisted.internet.html

180 questions
1
vote
1 answer

Reconnect to different address in twisted?

I have a server that sends my client the address of a backup server in case it goes down. On the server side the backup server is running. On the client side once the connection is lost I am not able to make the client to connect to the backup…
1
vote
1 answer

How can I get exit code of a twisted spawn process which may be terminated unexpected?

I'm using twisted to spawn a local process, which may be terminated in some condition. I have a custom twisted.internet.protocol.ProcessProtocol class for the reactor. If the local process abruptly terminated, I can't get the return value in…
halfelf
  • 9,737
  • 13
  • 54
  • 63
1
vote
1 answer

Autobahn+twisted reconnecting

I have a series of clients which need to be connected constantly to my server via ws protocol. For a number of different reasons, the connections occasionally drop. This is acceptable, but when it happens I'd like my clients to reconnect. Currently…
Mirac7
  • 1,566
  • 4
  • 26
  • 44
1
vote
0 answers

Make scrapy pipeline wait on another item in the same or previous pipeline

My problem is as follows: I have 3 item pipelines one FilesPipeline that download archives one ArchiveUnpackerPipeline that unpacks an archive one SymbolicLinkerPipeline that generates symbolic links to the contents of those archives The issue is…
ZeeD26
  • 11
  • 3
1
vote
0 answers

Twisted and "'module' object has no attribute 'SSL_library_init'"

I try to run below command: python millionaires.py --ssl player-1.ini But I got this error: Traceback (most recent call last): File "millionaires.py", line 152, in pre_runtime = create_runtime(id, players, 1, options, Toft05Runtime) File…
1
vote
1 answer

Best way to prevent a main thread from completing it's execution

An application, completely scheduled and monitored by some Job Monitor, implements a JMSMessageListener... now what is the best way to prevent this main thread (which is registering itself on JMS Queue) not to finish it's execution. Otherwise Job…
Manoj
  • 76
  • 6
1
vote
0 answers

Build protocol mechanism in twisted Site

I am trying to understand how and when the protocols are created for http requests in Site factory. Though I have a basic understanding of working of factory and protocols,My confusion arises because I see multiple protocols are created for single…
Learner
  • 157
  • 3
  • 15
1
vote
0 answers

Python twisted memory leak issue

class queryFactory(object): def __init__(self, request, sql,params): self.request=request self.sql=sql self.params=params def run_it(self): def getQuery(): return dbpool.runQuery(self.sql,…
1
vote
1 answer

Understanding Python Twisted Looping Call - Save the return of the LoopingCall function

I am using Twisted and making a Looping Call every x seconds. The function I use for the looping calls makes a return statement. def f(): # Obtain stuff return stuff def main(): LoopingCall(f).start(x) How can I retrieve the return…
1
vote
1 answer

Understanding Twisted and async programming. Why is a code working and another one is not?

Sorry first the wall of text. I am struggling to understand Twisted and async programming in general. I am using Python 2.7 with Twisted 15.4.0. I tried this example for downloadPage() and it works perfectly. I tinkered a bit with it, changing the…
1
vote
2 answers

Event when data sent in Twisted Python?

I'm writing a TCP/IP server using the Twisted framework. I am sending a very large stream of data, in small chunks. So I need to know when the data I've sent has made it through Twisted's buffers and into the OS, and the OS is ready for some more…
Jon
  • 19
  • 6
1
vote
0 answers

Restart LoopingCall task after error callback

My LoopingCall task stops when it executes an errorcallback and I want to restart it. My code looks something like this but I am not sure if I am doing it right or which would be the best way from twisted.internet.task import LoopingCall from…
lapinkoira
  • 8,320
  • 9
  • 51
  • 94
1
vote
1 answer

Python - Twisted client - check protocol.transport connection in ping loop

I'm creating TCP client socket with Twisted. I need to check connection status in a loop interval in connectionMade method. from twisted.internet import reactor, protocol class ClientProtocol(protocol.Protocol): def connectionMade(self): …
Aida.Mirabadi
  • 996
  • 4
  • 10
  • 27
1
vote
1 answer

Python - Twisted client - Maximum size of data in dataRecived method

I've recently been using and learning twisted for creating TCP client socket. I got that dataRecived method of Protocol class, returns all data together. It means all data ConCat with each other and finally it returns a long byte data from…
Aida.Mirabadi
  • 996
  • 4
  • 10
  • 27
1
vote
0 answers

twisted: how to delete a static resource?

I have a basic TCP server implemented in twisted, to which a client is connected. The client connects and sends data necessary to start a websocket resource. Using these details sent by the TCP client, I want to add an autobahn websocket resource as…