apparently leaving out a parameter in a method means it will silently not be called
hard to catch
Makes one really really miss the protections of an explicitly typed language
simpson
specing: If it makes you feel any better, no compiler can type-check the network.
specing
they cannot, but they can catch trying to pass a method that mismatches in the number of parameters
And why are these "Unhandled error in Deferred:" errors always : followed by two newlines?
there is no help at all
And adding .addErrback just makes things not work at all heh
meejah
you should get stacktraces from unhandled errors, IIRC. In any case you should be attacking an errback to every Deferred
attaching. although attacking might not be wrong either ;)
also what *is* the status of PB? am I wrong that "other things" should be preferred?
specing
I'm trying to, but apparently doing so has unintended consequences
meejah
that sounds very wrong; what is your errback receiving?
(most useful would be to pastebin your code)
specing
e.g. [Failure instance: Traceback (failure with no frames): <class 'twisted.internet.error.ConnectionRefusedError'>: Connection was refused by other side: 111: Connection refused.]
meejah
that's an errback from a PB call?
specing
very likely the one bound to dfr = factory.getRootObject()
But right now doing addErrback to another deferred object causes this call to block somehow, i.e. flow does not reach the code after it
meejah
can you pastebin your code? that shouldn't happen
specing
Oh was using .AddErrback instead of .addErrback
meejah
(i.e. attaching an errback shouldn't cause blocking)
specing
Another case of < specing> Makes one really really miss the protections of an explicitly typed language
meejah
unless maybe your errback is doing something weird?
specing
its just a print error & reconnect
meejah
you can do type stuff in Python if you really want that pain
(e.g. see mypy)
specing
Odd, there is no AddErrback in the API
but somehow it still works?
meejah
??
specing
Or maybe the stacktrace is supressed
i.e. python does produce an error, but it is supressed by Twisted
meejah
i think PB rips out stacktraces of "local" errors it sends across the wire
ch40s: I think if you stop the service (i.e. detach it from parent, and/or call .stopService()) then it won't reconnect any longer
[Arfrever] joined the channel
oberstet joined the channel
rthille-ciena joined the channel
terrycojones joined the channel
Abyll joined the channel
slav0nic joined the channel
rthille-ciena joined the channel
verterok` is now known as verterok
kolko joined the channel
mesozoic has quit
mesozoic_ joined the channel
mesozoic_ has quit
mesozoic joined the channel
aotaointbin
hey, i haven't used twisted in a while, anyone want to help refresh my memory?
simpson
aotaointbin: Twisted is a networking library. It comes with its own pluggable event loop, thread pool, a bunch of useful protocols, and various useful utilities.
aotaointbin
i have a long-running function A and a short-running function B, both running with task.LoopingCall.
but obviously B doesn't run while A is running. do i just insert yields into A or something?
aotaointbin can't remember how any of this works
ah, yes, @inlineCallbacks and yields, right?
simpson
Well, @inlineCallbacks isn't magic. You'll have to break your function up into parts; @inlineCallbacks does that for you, sort of, with a slight cost.
aotaointbin
right, i don't mind dropping a yield in front of any blocking io calls...
ah, wait, no, that's wrong too... everything needs to return a deferred...
aotaointbin needs to rtfm again :(
simpson
If you have blocking calls, then you either need to kick those out to the threadpool with .deferToThread() or you need to rewrite them to use Twisted's event-handling and not block.
aotaointbin
not my blocking functions, will need to deferToThread :(
so there's nothing like LoopingCallInThread? :P
jamesaxl
hi
how to transfer files using twisted?
simpson
jamesaxl: magic-wormhole has a Python API that is pretty decent.
aotaointbin: No, and also all the normal caveats of threaded programming apply, so you probably *don't* want to do that much work in a thread.
jamesaxl
simpson: thank a lot
aotaointbin
very limited shared state, not worried about race conditions.