hi, i have a serial connection which can handle approx 40 frames per second. my routine can calculate approx 2000 frames per second. is there any best practice or convenience for only accepting as much data as can be handeled?
SirScott
hey all, looking for some advice here. I'm building an app that has a mail server via internet.TCPServer(port, SMTPFactory(...)) and I'd like the port # to be variable via a config file. The app gets pkgd up as an RPM and I have a systemd .service file that runs twisted and my app. Ideally, being that it's a mail server, it'd run on port 25. The docs show me how to do the socket activation, but given that it's in the .service file
in the future, tubes ( https://github.com/twisted/tubes ) will hopefully make it easier to build systems with backpressure like that
garetjax_ joined the channel
garetjax has quit
garetjax_ is now known as garetjax
SirScott
fwiw, I have stumbled across this: http://superuser.com/a/892391, but I have to set that privilege on the python interpreter used to run twistd and that just feels wrong.
asdf
SirScott, i think irc cut your first line; "but given that it's in the .service file"..
SirScott
asdf: oh, thanks!
rnix
asdf: thx, will take a look
SirScott
... .service file, I lose the ability to change the port with a config file. Any suggestions for how I might allow execution on 25, but switching to a diff # if the user desires?
rnix
asdf: maybe best is to store a timestamp when the last frame has been calculated and skip calculation for this connection in calculation loop as long as my connections is not ready to receive
foom
SirScott: you probably want systemd itself to bind the socket using a .socket file, in which case you change the port by changing the systemd configuration file.
SirScott: that is, the port config is in the .socket file and that's what the user should be changing in order to change the configuration.
SirScott
foom: Yeah, hoping to have the configuration of the app in one location though, e.g. /etc/myapp/app.conf and not have them go change the .service file also.
foom: but if there's simply no way to consolidate, then that's just the way it is!
dude-x joined the channel
foom
SirScott: well, if you don't want socket activation, you can have systemd run twistd as root. twistd can drop privs after loading all the python code and running a bunch of startup grunk -- which includes binding ports -- but before actually starting serving.
SirScott
foom: interesting idea. Right now i have systemd doing that privilege dropping. Is it just the -u and -g args to twistd?
frode__ joined the channel
daniele_athome has quit
itamar joined the channel
foom
Yes. Although i'd really recommend having systemd do it for you, it's much simpler to drop privs *before* loading a mass of code than after.
(Just on general principles, I mean.)
SirScott
Maybe allowing python to listen on privileged ports isn't such a big deal afterall.
dude-x joined the channel
daniele_athome joined the channel
__marco has quit
daniele_nothome joined the channel
daniele_athome has quit
kenaan
pawelmhm submitted <https://tm.tl/#8212> - Invalid HTTP header not handled properly in HTTP client (unassigned) for review
introom
I have some data to send, like 100MB.
how can I send it in a row ?
callLater with the delay as 0 ?
__marco joined the channel
daniele_nothome has quit
itamar
introom: that would work
daniele_athome joined the channel
runciter joined the channel
__marco has quit
dude-x joined the channel
daniele_athome has quit
daniele_athome joined the channel
jstanley has quit
mesozoic_ joined the channel
dude-x has quit
dude-x joined the channel
jstanley joined the channel
introom
how does the reactor queue the callbacks ?
say, for example, if 3 different functions all do a reactor.callLater(0, func{a,b,c})
which func gets called first ?
itamar
you shouldn't rely on the order
so "doesn't matter"
floyd1 has quit
daniele_athome has quit
daniele_athome joined the channel
editshare-ericf joined the channel
dude-x joined the channel
dude-x___ joined the channel
tenth joined the channel
daniele_athome has quit
InfoTest joined the channel
dude-x___ has quit
daniele_athome joined the channel
brodolfo has quit
__marco joined the channel
licensed has quit
runciter has quit
efphe joined the channel
wuurrd has quit
dude-x joined the channel
dude-x joined the channel
dude-x has quit
daniele_athome has quit
dude-x joined the channel
daniele_athome joined the channel
dude-x joined the channel
InfoTest1 joined the channel
InfoTest joined the channel
licensed joined the channel
LionsMane has quit
aenglander joined the channel
dude-x joined the channel
daniele_athome has quit
dude-x___ joined the channel
aljohri joined the channel
daniele_athome joined the channel
dude-x joined the channel
__marco has quit
floyd joined the channel
LionsMane joined the channel
floyd has quit
dude-x joined the channel
floyd joined the channel
daniele_athome has quit
daniele_athome joined the channel
floyd has quit
dude-x___ joined the channel
dude-x joined the channel
licensed has quit
ggherdov joined the channel
tonythomas joined the channel
Brend joined the channel
licensed joined the channel
Lightsword joined the channel
glyph joined the channel
editshare-ericf has quit
kenaan
pawelmhm submitted <https://tm.tl/#8110> - setting `t.i.b.DelayedCall.debug = True` causes all tests to fail in Python 3 (unassigned) for review
aljohri joined the channel
daniele_athome has quit
daniele_athome joined the channel
evilaliv3 has quit
rebrec
Hello
i have a little question, regarding a basic TCP server using a Factory object which creates Protocols objects. I am looking for a way to make another instanciated object available to every instanciated Protocol objected... i am not good at Object Oriented Programming... neither i am to programming... but i would love to know if someone can explain me basically what "design pattern" i have to use for such a thing