glyph reviewed <https://tm.tl/#5645> - Document the correct way to deprecate a function in Twisted (assigned to adiroiban)
terrycojones has quit
terrycojones joined the channel
itamar has quit
daniele_athome has quit
aenglander has quit
new core defect https://tm.tl/#8309 by hawkowl: Twisted's coding standard does not ban the use of assertion statements
new core enhancement https://tm.tl/#8310 by hawkowl: Twisted's coding standard should state the convention for whitespace before inline comments
03hawkowl 10r4733214 trunk/twisted 05A(8304.misc) 07M(adbapi.py): Merge adbapi-txchecker-8304: Fix some low-hanging TwistedChecker errors in twisted.enterprise.adbapi. ...
hawkowl closed <https://tm.tl/#8304> - twisted.enterprise.adbapi has a lot of simple twistedchecker errors
aljohri joined the channel
runciter joined the channel
runciter has quit
Mixologi- joined the channel
runciter joined the channel
runciter has quit
tonythomas joined the channel
runciter joined the channel
chelly joined the channel
oberstet joined the channel
chelly has quit
floyd joined the channel
floyd has quit
evilaliv3 joined the channel
__marco joined the channel
evilaliv3 has quit
licensed has quit
daniele_athome joined the channel
licensed joined the channel
mat^2 joined the channel
castlelore joined the channel
garetjax joined the channel
floyd joined the channel
garetjax has quit
ccxQ has quit
ccxQ joined the channel
castlelore joined the channel
kolko_ joined the channel
floyd has quit
daniele_athome has quit
daniele_athome joined the channel
charlemagne joined the channel
darkhorse has quit
darkhorse joined the channel
runciter has quit
floyd joined the channel
Lukasa submitted <https://tm.tl/#8191> - Hide the transport backing the HTTPChannel object from twisted.web Resource objects. (unassigned) for review
floyd1 joined the channel
adamdangoor joined the channel
floyd has quit
garetjax joined the channel
aljohri joined the channel
efphe joined the channel
MiB joined the channel
terrycojones has quit
robbyoconnor joined the channel
evilaliv3 joined the channel
clokep joined the channel
robbyoconnor joined the channel
robbyoconnor has quit
robbyoconnor joined the channel
evilaliv3 has quit
ssbr_at_work joined the channel
daniele_athome has quit
itamar joined the channel
daniele_athome joined the channel
heftig joined the channel
heftig
is the latest and greatest way to have a web server as a Service to subclass StreamServerEndpointService and override __init__(serverFromString(reactor, "tcp:80"), Site(SomeResource())) ?
jonathanj
i'm pretty sure subclassing is not how you're supposed to do it
heftig
subclass MultiService instead and add the stream server service as a subservice?
jonathanj
pretty sure you're not supposed to subclass MultiService
How would a server make a request to another server, to receive a value for one of its configuration variable? The request value would start out as a deferred, right? How do you store it in a configuration variable somewhere, and not run anything that depends on it before it is ready? Should the server be using an external requests library (like requests) rather than agent.request?
asdf
wbh, treq is useful, but just using Agent is fine too; you mean the remote server speaks HTTP?
if so then sure, use Agent, or the getPage shortcut (or better yet, treq)
wbh
asdf: http to remote server, yes. The results seem to be deferreds, I do not understand how to store a result rather than immediately use it with a callback.
asdf
write a callback that will then store it somewhere
wbh
asdf: something along the lines of __setattr__ ? And return with an error anywhere it is used before being defined?
Well for a lambda at least I realize a normal function with normal assignment is equivalent.
asdf
wbh, depends, how do you want to use it afterwards? but sure, `def set_it(result): myobject.thing = result;; d.addCallback(set_it)`
terrycojones has quit
wbh, maybe show some code?
wbh
asdf: I can try to find the part again. I think I see now, though. Doing an assignment in a callback, and error handling if it has been unassigned an is attempted used, is the normal
method for doing this?
asdf
it very much depends; hang on, lemme write an example or two
wbh
I was confused since all the examples I could find of deferreds just immediately print it or pass it to another function, and I could not find any examples of the return value being stored for later use.
so we define a DeferredSemaphore with tokens=1 so it'll only allow one .run() at a time, and the others will wait
uh i know it's a bit hard to get at first but just bear with me here :)
wbh
the problem being the case where the concurrent calls happen before a cached result is available?
terrycojones has quit
asdf
right, and the last example fixes that, because when you use semaphore like that, only one _do_get at a time can run
so, let's say you call .get_data() more than once, only one call goes through to _do_get, and the rest wait on the semaphore
the first call finishes and sets ._cached
now the next call runs, and immediately returns ._cached
and btw we return succeed(_cached) so as to make _do_get always return a deferred, so the interface is always the same
and btw 2, `semaphore.run(f, 1, 2, 3)` -> `f(1, 2, 3)` (you need to pass args separately like that, because otherwise it'd just call the function right there)
__marco joined the channel
wbh
serve_data serves as a dummy function to simulate a remote server, right?
asdf
right
robbyoconnor joined the channel
robbyoconnor has quit
wbh
If the use case was to receive a configuration value from the remote server, a straightforward way would be to assign data to some attribute in use_something? It seems main returns a deferred.