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
0
votes
1 answer

ImportError: cannot import name 'tksupport'

I guess this is a dumb question, but I don't know how to solve my problem. I googled about it and also searched SO with no results. I'm learning tkinter and twisted, and was going through a basic example, but cannot import tksupport. I'm running…
Awer Muller
  • 557
  • 7
  • 17
0
votes
3 answers

Twisted reactor blocks for long deferred tasks

I am working on a projects that involves making many requests to an api and for each feedback I am making a decision and saving in the db. I am using adbapi to communicate to mysql. I am receiving the request as a POST containing a list of items…
Eutychus
  • 442
  • 8
  • 12
0
votes
1 answer

Receive data from client without using "dataReceived" function in Twisted

How to receive the data from the client, bypassing the standard class function Protocol? For example, class TW(protocol.Protocol): def get_data(delim = '\n'): #some code return data I.e, without using the function…
Rubikoid
  • 3
  • 2
0
votes
0 answers

How to parse encrypted data in function dataRecieved in twisted?

In my project I inherited twisted protocol from twisted.internet.protocol import Protocol, As we know, I should do something packet manipulation in the function dataRecieved, However, the doc said: data: a string of indeterminate length. Please…
Alex Chan
  • 1,116
  • 3
  • 15
  • 33
0
votes
1 answer

How to stop Twisted callback?

I wrote a callback function using twisted Now my question is when websocket connection dropped I need to stop this callback. def sendBack(self, payload): # find correct way to identify connection dropped now using wasnotcl... if…
user4079217
0
votes
1 answer

Twisted. Error callback on spawnProcess's processExited

I am running a command with Twisted's ProcessProtocol. I am using the documentation scaffold and I have several events like inConnectionLost, connectionMade, etc But when the process finish this event is triggered: def processExited(self, reason): …
lapinkoira
  • 8,320
  • 9
  • 51
  • 94
0
votes
1 answer

Pipe Twisted Request Content to STDIN of Process

I'm looking to pipe the content of a HTTP POST or PUT to STDIN of a process. I'm using the Klein library and have the following code: from klein import run, route from twisted.internet import reactor, defer, protocol import os class…
wspeirs
  • 1,321
  • 2
  • 11
  • 22
0
votes
1 answer

Twisted url action routing

If I have for example this simple TCP server: from twisted.internet import reactor from twisted.web.resource import Resource from twisted.web.server import Site from resources import SomeResource logging.info("Starting server...") root =…
lapinkoira
  • 8,320
  • 9
  • 51
  • 94
0
votes
1 answer

inlineCallbacks for a Protocol.dataReceived in Twisted

I seem to misinterpret the rules of dataReceived and inlineCallbacks. More specifically, when I do this: def dataReceived(self, data): self.transport.write('ok') my Protocol really sends the data, but when I do this: @defer.inlineCallbacks def…
Eugene
  • 656
  • 8
  • 20
0
votes
1 answer

Python SSH Server(twisted.conch) get the user's commands

I am willing to deploy on my server an SSH daemon which I can know what commands was executed. But I don't know how to get the user's commands. I achieve a SSH server based on twisted.conch.ssh.session. I can get all stdout in outReceived of…
chzijian
  • 21
  • 5
0
votes
1 answer

Scrapy (1.0) - Signals not received

What i'm trying to do is trigger a function (abc) when a scrapy spider is opened, which sould be triggered by scrapys 'signals'. (Later on i wanna change it to 'closed' to save the stats from each spider to the database for a daily monitoring.) So…
beaker
  • 3
  • 2
0
votes
1 answer

how to make autobahn / twisted websocket server restart / stay up after exception

I have a websocket server using autobahn where it runs some code onMessage. during this code an exception happens and I perform a try/except clause so I can log the error, it logs correctly. However the connection to the client(javascript)…
user1601716
  • 1,893
  • 4
  • 24
  • 53
0
votes
0 answers

How to call a Twisted reactor from a file different from his?

I have a question that could well belong to Twisted or could be directly related to Python. My problem, as the other is related to the disconnection process in Twisted. As I read on this site, if I want to I have to perform the following steps: The…
0
votes
1 answer

What does "d.addCallback(lambda protocol: protocol.ready)" do in Pika's Twisted example?

The setup in Pika's example code with Twisted looks like this: parameters = pika.ConnectionParameters() cc = protocol.ClientCreator( reactor, twisted_connection.TwistedProtocolConnection, parameters) d = cc.connectTCP('hostname',…
Chris Martin
  • 30,334
  • 10
  • 78
  • 137
0
votes
1 answer

Twisted reverse proxy SSL backend

I'm fairly new to twisted, and trying to utilize twisted.web.proxy.ReverseProxyResource to create a reverse proxy. Ultimately I want clients to connect to it using SSL, then I'll validate the request, and pass it only to an SSL backend server. I'm…
Alex
  • 35
  • 6
1 2 3
11
12