1
vote
0answers
27 views

Python - Make Named Pipe and Keep It Open…Unexpected Behavior

I am trying to emulate creating a pipe and keeping it open. In Bash, I would mkfifo /tmp/myfifo; cat > /tmp/myfifo. In Python I have: import sys import os import string import subprocess import ...
1
vote
2answers
44 views

Django: strategy for preventing duplicate object creation

I'm running into an issue of creating multiple DB objects when I only ever expect one. My application models consist of a Form with a collection of Fields, and a FormEntry with a collection of ...
0
votes
1answer
22 views

Python equivalent of Java's `tryLock` (idiomatic)?

In Java tryLock(long time, TimeUnit unit) can be used as a non-blocking attempt to acquire the lock. How can the equivalent in python be achieved? (Pythonic | idiomatic way is preferred!) Java ...
1
vote
1answer
55 views

Twisted - Using a Deferred for another sql query

I've got a twisted based network application. Now I would like to implement a new database design but I''m getting stuck with the Deferred object. I write sessions into my database by using this two ...
2
votes
2answers
61 views

How to make a library asynchronous in python

In my job they "leverage" tornado but they have no asynchronous libraries. What makes a library asynchronous so that it can be better suited to something like tornado? Are there any good examples ...
0
votes
1answer
72 views

Wrapping a tornado.gen.engine-wrapped function with another function

Say, I have a function, that is wrapped with gen.engine to "straighten out" the callback chain, that is, so that the code appears to be synchronous / linear / whatever. The function, then looks like ...
1
vote
0answers
24 views

Tornado blocking time

Tornado is regularly benchmarked at 1000req/s or above. I have a blocking library that I would like to call (potentially in each request). If the library takes 30ms to complete and return, does that ...
0
votes
1answer
100 views

Understanding tornado coroutine decorator + twitter authentication

I am new to Tornado and trying to get simple OAuth twitter authentication working. As per the documention, I need to set up an authentication handler as follows: class TwitterAuthHandler(BaseHandler, ...
0
votes
2answers
57 views

In Tornado, how can I see Exceptions rasied in a coroutine called by PeriodicCallback?

I wrote a program which has a coroutine called periodically from the main ioloop like this: from tornado import ioloop, web, gen, log tornado.log.enable_pretty_printing() import logging; ...
2
votes
0answers
54 views

Extending tornado.gen.Task

Here's the interesting bits of a stupid websocket clock: class StupidClock(websocket.WebSocketHandler): clients = {} @web.asynchronous @gen.coroutine def open(self): ...
1
vote
1answer
50 views

Python's TCPSocket vs. Asyncore

I created a simple Project with Python. It simply a server/client app. Python is server. I created this code for my server: import socketserver class MyTCPHandler(socketserver.BaseRequestHandler): ...
0
votes
0answers
44 views

Python: [Help] Best use of asynchronous timer (Non Blocking Timer)

My question is if I have a thread program that runs in an infinite loop and each loop does a simulation step, at every loop there might be a request for timer to do something. This sounds easy but the ...
1
vote
2answers
37 views

how to recieve line from a html page to twistd web server

I just want to ask that if it is possible to to receive chat from an HTML page to twisted web server and PUSH it on to another HTML page asynchronously. I just want someone to point out the way to do ...
3
votes
1answer
93 views

Python equivalent of Perl's HTTP::Async->next_response

I'm looking for a way to do the equivalent of Perl's HTTP::Async module's next_response method The HTTP::Async module doesn't spawn any background threads, nor does it use any callbacks. Instead, ...
3
votes
3answers
111 views

asynchronous subprocess with timeout

I have a problem with spawning asynchronous subprocesses with timeout in Python 3. What I want to achieve: I want to spawn multiple processes asynchronously without waiting for a results but I want ...

1 2 3 4 5 22
15 30 50 per page