IRC Logs for #circuits Sunday, 2014-09-21

*** javier_ has joined #circuits00:53
javier_Hi! I'm beginning to use circuits and I have some questions. Is anyone up?00:53
javier_The questions are regarding best practices.01:03
prologichi javier_01:46
prologicfire away :)01:47
prologicon phun intended :)01:47
prologic*no01:47
javier_:)01:53
javier_First, when developing TDD, how do you structure the code?01:53
prologicahh01:57
prologicjust like in examples/testing01:57
prologic:)01:57
javier_Oh, I'll take a look.01:58
prologichttps://bitbucket.org/circuits/circuits/src/tip/examples/testing//pytest/01:58
prologicthis question was asked before :)01:58
prologicso we added an example of how to do it with pytest01:58
prologicall of our own unit and intergration tests are done this way01:58
javier_Thanks! Another, I saw servers which handle many connections but not clients. How would you structure that?01:58
prologicgood question01:59
prologicI believe our client socket implemtnation(s) do not handle mutiplexing very well in the same light as our servers do01:59
prologicbit of a design flaw or lack of foresight there01:59
prologicI'd like to improve that01:59
prologicmy main use case was for an async web crawler01:59
prologicihmo the base component for all clients in circuits.net.socekts.Client02:00
prologicjust needs to grow the same internal structures for managing many socket objects02:00
prologicand passing that along with the respective events02:00
prologicproblem is this would ofc break backwards compatibility with anything using client connections :)02:00
prologicso maybe someone can contribute a MultiClient socket component :)02:01
prologicthe only way to do it now (works but isn't as nice)02:01
prologicis to spawn multiple instances of your client connection (e.g: TCPClient)02:02
prologicbut with different unique channels02:02
prologici.e: using something like uuid4()02:02
prologicit works but ihmo it's unnecessary -- we should just improve circuits.net.sockets.Client to handle multiplexed connections02:02
javier_How can I create handlers for dynamic channels?02:03
javier_Or how can I register handlers in the new channels as I create them?02:04
prologicwell you don't need to as such it's handled for you02:04
prologicyou just spin up multiple instnaces of the component02:04
prologicon different channels02:04
prologiclet me construct a contrived example02:04
javier_It's too much. Let me figure it out on my own, don't worry!02:06
prologichttps://gist.github.com/c68e4f6cac0ae2cf594c02:10
prologicsimple example based on examples/wget.py02:10
javier_Looking...02:21
javier_I see what you mean. If the component creating the clients (TCPClients) needed to handle the events directly, I don't see how to apply this approach. Would it work? Should I use an intermediate component to create an explicit request/response?02:24
prologicit should02:33
prologicif you *did* want to create more dynamic event handlers at run-time02:33
prologicas opposed to declaring them up-front on the classes/componets02:33
prologicyou'd use .addHandler() and .removeHandler()02:34
prologictypically we don't see much use-case for this kindo f thing though :)02:34
javier_Ah, yes. For got about those two. You have been very helpful. I appreciate your help.03:58
javier_The application that I'm trying to implement consumes jobs from a queue, performs a few network connections and puts the result in another queue.04:00
javier_I found the concept of Components and async events a nice abstraction but it's getting messy as the codebase grows. I guess I lack experience. :)04:00
prologicheh04:30
prologicyeah clean design and code comes with experience I'm afarid :)04:30
prologicno "magic silver bullet"04:30
prologicnot even with a framework such as circuits :)04:30
prologicin any case, circuits and it's component library should help you with your use-case04:31
javier_Thanks! :)04:48
prologic*sigh* I wish weekends were longer :)06:43
prologichttp://dilbert.com/strips/comic/2014-09-21/?utm_source=feedburner&utm_medium=feed&utm_campaign=Feed%3A+DilbertDailyStrip+%28Dilbert+Daily+Strip%2906:47
robert_sup prologic06:51
prologichey06:58
prologicwishing my weekend was longer :)06:58
prologicyou?06:58
robert_wishing a whole bunch of things. :p06:58
Yamahi09:35
prologichi10:53
*** ninkotech__ has joined #circuits14:49
*** ninkotech_ has quit IRC14:50
*** ninkotech has joined #circuits15:01
*** ninkotech__ has quit IRC15:02
*** ninkotech has quit IRC15:09
*** ninkotech_ has joined #circuits15:14
*** ninkotech_ has quit IRC15:28
*** ninkotech_ has joined #circuits15:48
*** ninkotech_ has quit IRC16:31
*** ninkotech_ has joined #circuits16:32
*** An_Ony_M1ose has joined #circuits21:29
*** An_Ony_Moose has quit IRC21:31
Yamagn821:55
*** Workster has joined #circuits23:40

Generated by irclog2html.py 2.11.0 by Marius Gedminas - find it at mg.pov.lt!