IRC Logs for #circuits Thursday, 2013-12-19

*** litzomatic has joined #circuits00:10
*** ircnotifier has quit IRC00:45
prologiclitzomatic:  hey01:00
prologicin the paste above01:00
litzomaticwhat's up :)01:00
prologicI did not see any other event being fired01:00
prologicoh wait01:01
prologicnow I see it01:01
prologicshow me the code for this?01:01
prologicI wanna test it :)01:01
litzomaticYeah, I'm unsure how to incorporate Server with Worker01:01
litzomaticI tried both registering it and not01:02
prologicpaste me the code to somewhere like
prologicI notice I don't have a tests/web/test_worker.py01:02
prologicI should write one of those too :)01:02
litzomaticI could ask the question on stackoverflow :)01:02
litzomaticpublicity :) haha01:02
prologicyou could :)01:03
prologicyou'd then get an answer form me :)01:03
prologicmaybe let's look at this first :)01:03
prologicincase it's a bug/missing-feature01:03
litzomatichaha, we'll wait for prime time later.01:04
litzomaticI tried doing + Worker as well with the same result01:05
litzomaticits the sleep_worker method01:05
litzomaticoh ignore my note, its old. I now understand your reasoning :)01:05
litzomaticthe first one not the second one, I'm still curious on that :)01:06
litzomaticAlso, it's interesting the code does not run in python201:10
litzomaticFood, brb.01:12
prologicruns fine in Python 2 :)01:13
prologicI'm using 2.7.6 here01:13
prologicwhat I'm noticing is that the task doesn't complete01:13
prologicwhich is a bit suspicious01:14
prologicthere you go01:16
prologicfixed and working01:16
prologicno bugs or missing features in circuits01:16
prologicdiff it against yours01:16
prologicand make note of the notes I added01:16
prologicnow I have to figure out why adding *args, **kwargs to the function is important01:16
prologicit isn't called with anything unless you pads more arguments or keyword arguments to the ask(f, *args, **kwargs) event01:17
prologicI'm an f'n moron :)01:18
prologicI'd better write a test case for that01:18
prologicthere was a bug in circuits.core.Worker01:18
prologicI was doing01:18
prologicself.pool.apply_async(f, args, kwargs)01:19
prologicself.pool.async_apply(f, *args, **kwargs)01:19
prologicbah :)01:19
prologicsorry about that!01:19
*** litzomatic has quit IRC01:23
*** litzomatic has joined #circuits01:24
prologichrmm no wait01:24
prologicI'm confusined01:24
prologicIRC Logs:
prologicin case you missed something01:24
litzomaticyeah I got it looks like01:26
litzomaticso it should be working, but strang wonder what my python2 is doing..01:26
litzomatic$ python -V01:27
litzomaticPython 2.7.601:27
litzomatic$ python circeval.py01:27
litzomatic  File "", line 5701:27
litzomatic    return result01:27
litzomaticSyntaxError: 'return' with argument inside generator01:27
prologiclook at my paste above01:29
prologicthat is invalid python :)01:29
prologicyou cannot have return inside a generator01:29
prologicyou either use yield or return01:29
clixxIO_Hi prologic01:29
prologicnot both01:29
prologichi clixxIO_01:29
clixxIO_this is a left-of field question but have you thought of circuits implementation in C?01:30
clixxIO_for embedded systems?01:30
clixxIO_I don't expect it done by lunchtime01:31
clixxIO_or, maybe you know of a C/C++ implementation that is similar to circuits01:33
*** ircnotifier has joined #circuits01:33
prologiccommitted and pushed up a few extra unit tests01:33
prologictesting passing arguments to task's function01:33
prologicclixxIO_:  C? hmm no :)01:34
prologicsomething similar to circuits in a lower-level langauge?01:34
prologicafarid not :)01:34
prologicthis sort of thing tends to be only available in dynamic langauges01:34
prologicit would be near impossible to implement in C01:34
prologicthere are parts of circuits that could be optimized01:34
prologicand C extensions using Cython could be written01:35
prologicfor example we could add in another poller01:35
prologicthat wrapped libevent (which there are python bindings for)01:35
prologicmaking I/O polling a lot faster01:35
prologicit's just a matter of "someone doing the work" for that :)01:35
prologicwhy C/C++? what's the need?01:36
clixxIO_someone was around - but went for lunch01:36
prologicsmaller footprint?01:36
clixxIO_to run on embedded devices01:36
prologicyeah but that doesn't mean much to me01:36
prologicyou can run python on embedded devices easily01:36
prologicwell depends on the device of course01:36
prologicbut there are many that you can run Python on01:36
prologicI mean: how embedded are we talking?01:36
prologicArduino embeddd?01:36
prologicwell I'm afraid from a software engineering principle01:37
prologiccircuits would just not be suitable at all01:37
prologicno matter how you tried :)01:37
prologicyou'd barely even get the message bus working very well01:37
clixxIO_so I'm talking only having a program logic that might only be 20 lines of code01:37
prologicyeah well then01:37
clixxIO_the message bus is ok01:37
prologiccircuits is not the thing to use :)01:37
prologicif it's just 20 lines of code01:37
prologicjust write in in RPython01:37
prologicand compile it01:38
prologicor use plain C and compile it01:38
clixxIO_the 'user-logic' is 20 lines01:38
prologicI'm just saying :)01:38
clixxIO_the circuits side could be 500 - 5000 lines01:38
prologicyou're asking a hard thing :)01:38
prologicno :)01:38
prologictry more like 2-3x the current code base of "core"01:38
clixxIO_fair enough01:39
prologicso yeah01:39
prologicyou're in the ball park :)01:40
prologicmaybe 5-6kloc01:40
prologicand that's under estimating01:40
prologicif you were to rewrite circuits.core in C/C++01:40
prologicyou'd have a hard time getting it under 10kloc01:40
prologicyeah so :)01:41
prologicthat's great01:41
prologicbut there's only one small part :)01:41
prologicif you want to port circuits.core01:41
prologicwith compatibility with circuits's API and internals01:41
prologicthat's not going to be trivial :)01:41
prologicanyway look01:42
prologicPython _can_ be made to run on _some_ embedded devices01:43
prologicyou seen pymite01:43
prologicand what's the other embedded implemtantion of Python01:43
prologictinypy - that s it01:43
prologicthe wonderful thing is01:43
prologicif you were to get tinypy running on your device01:43
prologiccircuits *should* "just work"01:43
prologicbecause circuits _does not_ use Multiple Inheritence01:44
prologicwhich a lot of embedded python implemtantions do not implement or support01:44
prologice.g: tinypy only supports  single inheritence01:44
litzomaticstrange... I got it to work once...01:44
prologicso if you're serious about doing this01:44
prologicI'd say get an embedded version of python working01:44
prologictel me what it is01:44
prologictest circuits on it01:44
prologicand we'll fix the issues that arise01:44
prologiclitzomatic:  got what to work once?01:45
litzomaticthe server code01:45
litzomaticlooks like I got it to work again01:45
prologicyeah the version I posted above works fine01:45
prologicbut yeah01:46
prologicdon't mix return/yield in functions01:46
prologicyou can only use one or the other01:46
litzomaticit only worse for me on some starts01:46
prologicyield will result in the function becoming a geneator01:46
litzomaticother starts it times out01:46
prologicthat's weird01:47
prologica subsequent request doesn't complete01:47
litzomaticNo. Sometimtes the server starts up and it works01:47
litzomaticSometimes the server starts up and it does not work01:47
litzomaticif it works it keeps working01:48
prologicnot the behavior I'm seeing01:48
prologicI smell bug somewhere01:48
prologicbut no obvious errors are being thrown01:48
litzomaticstarted up and its working this time01:48
litzomaticI will try to reproduce again.01:48
prologichold on01:50
prologicyou're also doing multiprocessing of the server too01:50
prologiccrap :)01:50
prologicthis could get messy01:50
prologicas you're bringing down into the sub-processes then pool/workwer too01:51
prologiccould get very ugly01:51
litzomaticso the run logic?01:51
prologiclet's try without01:51
prologicyeah without it works very time01:52
prologicyeah I'm not going to have time to look at that particular edge case today01:52
prologicit sort of sounds like we need an initialization function01:52
prologicwhich i optionally passed to .start(process=True, initializer=my_init)01:52
prologicwill call the function with the top-most component (the manager)01:53
prologicand let you do some "extra" initialization01:53
prologiclike e.g:01:53
litzomaticso is it a race condition that sometimes it works?01:53
prologicassuming you had:01:53
prologicdef my_init(manager):01:53
prologic   ...01:53
prologicI think so01:53
prologiceither a race condition01:53
litzomaticI like race conditions01:53
litzomaticMaybe I will take a look01:54
prologicor forking with multiprocessing.Pool in the current process doesn't work so well01:54
prologiccould be either or both really01:54
prologicif you could that'd be great :)01:54
prologicyou know what .start(process=True) does right?01:54
prologicit basically forks the process using multiprocessing.Process()01:54
prologicso that's where you can get a shared listening socket01:54
prologicbut that's the only use-case I've tested successfully01:54
prologicyou're not trying to drag in a multiprocessing.Pool as well :)01:55
litzomatichmm interesting.01:55
prologicI'd like to at some point int he future implement a SocketPool too01:55
prologicso can reuse socket objects01:56
prologicand not have to recreate new ones every time01:56
prologicbut that's a totally different thing altogether :)01:56
litzomaticHow do shared listening sockets work?  I'll have to look into that.01:56
prologicbasically the kernel takes care of the load balancing01:57
prologicso that when you're code polls the socket01:57
prologicone of the presses will end up accepting the connection01:57
prologicI'm almost certain this is how it works01:57
prologicor we would not have implemented .start(process=True) :)01:57
prologicit's a very naive form of load balancing01:57
prologicbut it works01:57
litzomaticThat's funny I mess up you're and your all the fucking time too, so I always use you are now :) Sorry, something I just noticed.01:57
prologicI've tested it with over 7k req/s at a concurrency of 1000 on a BSD machine01:58
prologicThanks to koobs01:58
prologicargg cra01:58
prologicsorry :)01:58
litzomatic7k req/s is more then enough for a typical application haha.01:58
prologicI meant your01:58
prologicI normally don't mess those up01:58
prologicon decent hardware01:59
litzomaticit's the bane of my grammatical existence.01:59
prologiccircuits.web can do (raw) 3k/s01:59
prologicnormally I'm quite strict with it comes to grammar :)01:59
litzomaticYou know I just adopted a new opinion on software, sort of related to grammar.02:00
litzomaticIt was after reading a paper by Dyjkstra02:00
prologicSoftware Developers that design and implement new programming languages often have very strict use of grammar in everyday language and speech? :)02:00
litzomaticI'm going to try to not refer to software by using innapropriate metaphors, like the software is getting smarter.02:01
litzomaticHe also talked about how maitenence is the wrong word :)02:01
litzomaticBasically said software does not need to be "maintained" its done, it everything else that changes :)02:02
prologicI agree02:03
prologicIf you have strict control over your environment02:03
prologicno software ever needs to change02:03
litzomaticI also thing managers get the wrong idea, they think of it as overhead to  maintain software, when in fact we are iteratively improving and advancing the software thus constantly producing value.02:03
litzomaticAll because we use wrong words :(02:04
litzomaticOh software needs to change because people change mainly :)02:06
litzomaticThey adapt to it, find problems, think of new ways they want to use it.02:06
litzomaticSoftware creates the demand for more software, Yay!02:06
prologicthat's absolutely right02:07
prologicyou cannot improve without change02:07
prologicso software must change and adapt all the time02:08
prologicit's not maintenance02:08
prologicit's improvement02:08
prologicI cannot begging to imagine how much "better quality" circuits is today02:08
prologiccompared to 9 years ago02:08
litzomaticYeah, never worked on anything that long!02:09
litzomaticI can only imagine.02:09
prologiccircuits started it's life officially in 200402:10
litzomaticLooking at Python and how the core team works is the closest I get to actually seeing the process in action with how much record they have.02:10
prologicand earlier before that in 2002/2003 as pymills.event02:10
litzomaticpymills never heard of it hmm02:11
prologiclook into that Worker + .start(process=True) issue for us02:11
litzomaticsuppose its morning there for you?02:11
prologicit'll be good to make that work seamlessly too02:11
prologicpymills - I never published it :)02:11
prologicit was my very first package02:11
prologicI've since published it now to PyPi02:11
prologicbut it has very little value02:11
prologicjust a bunch of crap really where I have nowhere else to throw it02:11
prologichas a few useful things but not much02:11
prologicIt's actually lunch time02:12
prologicjust waiting on a call from the jeweler so I can go pick up my wife's anniversary present02:12
litzomaticah :), I haven't started buying jewelry for my GF yet, once it starts it will never stop ;)02:13
litzomaticStarts with the darn wedding ring, right? ;)02:13
litzomaticThat's how they get ya.02:13
prologicoh it's not that bad02:24
prologicdon't be silly :)02:24
litzomaticDepends if I buy cubic zerconium or not ;)02:25
prologicno don't do that02:25
litzomaticlol, I know my GF already told me!02:25
prologicI saved up for my wife's engagement ring over 7 months02:25
prologicreligiously every 2 weeks I paid a bit ore off02:25
litzomaticMy brother lost his haha02:26
litzomaticand his second one02:26
litzomaticnow he wears 10 dollar rings02:26
prologicnot cool02:27
litzomaticthey had insurance on the first one, but it id not cover "mysterous dissapearence"02:27
litzomaticyeah :(02:28
litzomaticHe did lose it having a good time on his birthday at least.02:28
prologicnot good :)02:32
prologicyeah normally you have to pay quite a lot of money to have that kind of insurance02:32
prologic"lost properly" insurance02:32
prologicand/or "accidental breakage"02:32
litzomaticWell have a good rest of the day. I'm off :)02:37
*** litzomatic has quit IRC02:38
clixxIO_Just wondering, is there a tcp to serial forwarder?03:24
SXon circuits? haven't seen one03:40
SXbut in pyserial lib there is a few tcp <-> serial bridges03:41
SXas examples03:41
SXmy goal for the near future is to write some good tcptoserial bridge with modules for different serial bus devices' protocols03:42
SXso to say, the gateway =)03:42
SXI need it for work, and I have something simmilar written on C++ for now, but now I need flexibility more than speed03:45
clixxIO_oh yeah, I should take another look at the pyserial tcp<->serial-bridge03:46
clixxIO_actually a lot of python sockets servers/clients compare very favourably with raw c03:46
clixxIO_there's hardly any point of servers written in C/C++ anymore03:47
SXI'm C/C++ developer03:47
clixxIO_I didn't mean you +SX :-)03:48
SXand with cython it becomes quite easy to reuse code written on c/c++ in python03:48
clixxIO_work question: can circuits handle weekly events? like do a backup at the end of the week?03:49
clixxIO_assuming I have the code for the backup part03:49
pdurbinclixxIO_: you jogged my memory of this post: Why should I have written ZeroMQ in C, not C++ (part I) - 250bpm -
clixxIO_yeah, I agree with that post03:52
clixxIO_well I put 604800 into a timer object and it didn't throw it out. So until I wait a week I assume it can do weekly backups03:56
clixxIO_but less than a second seems a problem : Timer(0.1, Event.create("Ping"), persist=True).register(self)03:57
SXdoes timer use seconds?03:58
clixxIO_seems to, but nothing less than a second03:59
clixxIO_maybe I'm doing it wrong04:03
clixxIO_yes, I was doing it wrong, timer events < 1 second do work - my bad sorry04:05
prologicback form lunch04:11
prologicclixxIO_: Just wondering, is there a tcp to serial forwarder? <-- no :) write one :)04:12
prologicclixxIO_: work question: can circuits handle weekly events? like do a backup at the end of the week? <-- yes04:13
prologicclixxIO_: well I put 604800 into a timer object and it didn't throw it out. So until I wait a week I assume it can do weekly backups <-- pass in a date time object instead04:14
prologicclixxIO_:  I think the precision of the circuits event loop is not precise enough for < 0.1 (TIMEOUT)04:15
prologicI don't like this04:15
prologicit should be possible to fire a timed event of any precision04:15
prologicwithin the limitations of your system that is04:15
prologicwithout eating a lot of CPU04:16
prologicclixxIO_: yes, I was doing it wrong, timer events < 1 second do work - my bad sorry <-- oh :)04:16
prologicwhat did you do wrong?04:16
prologicsorry just catching up my back log :)04:16
clixxIO_just beginners luck/stupid04:18
prologicyes so Timers with any valid seconds or date time interval work just fine :)04:18
prologicjust tested that on the REPL04:18
prologicstill curious as to what you got wrong ?:)04:18
prologichelp me better understand how to make circuits even more simpler to understand and easier to use :)04:19
clixxIO_changed: Event.create("foo"), persi -> Event.create("ping"), persi and then wondered why my foo event didn't fire04:19
prologicoh :)04:20
prologicyou created the wrong event?04:20
clixxIO_just changed the name of the event but didn't look 'up' the code04:20
clixxIO_foo always confuses me, but I am a minority case04:21
clixxIO_it's ok now04:22
prologicyeh typically in many programming circues04:22
prologicfoo, bar, foobar, and hello world04:22
prologicare often used to represent utter crap04:22
prologici.e: I can't be bothered calling this something better04:22
prologicI do it04:22
prologicmany others do :)04:23
prologicif you grep the circuits code base for "foo"04:23
prologicyou'll probably find lots of references :)04:23
prologic$ grin -i "foo" | wc -l04:23
prologic     48604:23
prologic$ grin -i "bar" | wc -l04:23
prologic     22504:23
prologic$ grin -i "hello" | wc -l04:24
prologic    162104:24
clixxIO_yeah, well I'm mostly trying to map the examples into some production-system use-cases04:25
clixxIO_we have automatic mailers that scan directories04:26
clixxIO_our linux kernel is 2.4 but I got permission to upgrade04:26
prologicwow 2.4 is old!04:26
prologicgeez :)04:26
clixxIO_server runs for 3+ years without reboot04:26
prologicremember to use Worker for any cpu bound work04:26
prologicdon't tie up the event loop :)04:27
prologicyeah my old server before I migrated to a different data center was up for that long too04:27
prologicbut I think I'll migrate my server(s) to Germearny04:27
prologicafter the US revelataions04:27
clixxIO_Germany is just as bugged, if not more04:28
clixxIO_the only reason you should go there is because you like the beer04:28
clixxIO_which to me is valid04:28
prologicmaybe it's less bugged than US based data centers04:31
prologicbut also their prices and features are better than any US offerings04:31
prologicI'm hosted with a data center called Codero Hosting04:31
prologicthinking of migrating my server to
clixxIO_if somebody gave good recommendations for them, go for it04:36
prologicyeah :)04:38
prologicit's good to see circuits take up some momentum again04:52
prologicI should continue answering questions on SO :)04:52
prologicFYI: I suck at marketing :)04:52
prologicI've never really pushed the marketing of circuits in the Python community relaly04:53
prologicand I don't blog all that well or all that often04:53
clixxIO_I do a few talks at the python user group in sydney04:55
clixxIO_but they say I suck at python and my code quality also sucks04:56
clixxIO_you could talk in Europe or Asia more04:56
clixxIO_I used to live and work in Germany. It's pretty good there04:59
clixxIO_I'm just looking at in examples, that could translate easily to C+05:01
clixxIO_as in 'maybe'05:01
clixxIO_I'm just thinking of having something that is 'better' than arduino05:02
clixxIO_but.. I have no immediate need to create it at the moment05:05
prologicanything can be translated to C++05:06
prologicthe question is why?05:06
prologicand do you really want to go to all that effort05:06
prologiclower-level languages cost far more development time05:06
prologicit's often not worth it for many use cases05:06
prologiccertainly not application development05:06
prologichigher level languages are "fast enough"05:07
prologicPython is especially05:07
prologicand especially PyPy05:07
prologicI tried to present a talk to PyCon AU this year in fact in Tasmania05:07
prologicbut my proposal got rejected05:07
prologicmaybe I'll try again with PyConAU next year which will be held in Brisbane05:07
prologicso hopefully I'll (and my colleagues) will all be going05:07
prologicI'll try re-proposoing a quick talk on circuits then05:08
clixxIO_I have a specific requirement. To run on a tiny single function processor board05:16
clixxIO_and have some code interchangeability between systems05:19
clixxIO_what I really mean is that your event coding layout is really "nice"05:21
clixxIO_and embedded code on these processors really sucks05:21
clixxIO_so move "nice" -> where-stuff-sucks05:21
clixxIO_still keep the python for bigger systems05:23
prologicso ... here's a proposal05:25
prologicbuild a C/C++ library that interoperates with circuits serialization and birding mechanisms05:25
prologicthere is: circuits.core.bridge05:25
prologicand circuits.node05:25
prologicthey need to be expanded a bit more and tested more throughouly05:25
prologicbut that would be the approach I'd take05:25
prologicmake circuits apps talk to embedded sytesms/devices, etc over a "communications protocols"05:26
prologicala a bridge05:26
prologicI had plans to even make this work over the web05:26
prologicso you could present a RESTful end point in some circuits.web web app05:26
prologicand act as a gateway/bridge into the rest of the system via circuits serialized events05:26
prologice.g: serialized as JSON for example05:26
prologiccircuits.core.bridge is used to bridge sub-procesess in circuits (for the moment)05:26
prologicand uses python's pickle05:27
prologicand circuits.node is designed more for distributed computing and designed to talk to otter non-circuits sytesms using json as serlaization05:27
clixxIO_It sounds all good and nice - people are chasing something like that05:28
clixxIO_I have no unrealistic expectations on the project time-to-complete05:29
clixxIO_I've already done some of the JSON stuff05:29
clixxIO_circuits is so well thought out - it's what I always wanted but never could have done05:30
clixxIO_it just needs to be adapted for use in circuits now :-)05:31
*** SX has joined #circuits05:32
prologicthat's very nice of you to say :)05:35
prologicthere are some parts of the internals I still want/need to tidy up05:36
prologicbut yes I do agree05:36
prologicoverall it is quite a nice api and framework05:36
prologicand I use it everywhere for my own proejcts05:36
prologicand at work wherever I go05:36
prologicso yeah05:36
prologicin short I think creating a bridge is the way to go05:36
prologicrather than trying to port all or some subset of circuits to an embedded device05:36
prologicjust build a compatible layer05:36
prologicthat can talk to circuits.node over JSON05:36
prologicfor example05:37
prologicbidirectionally of course05:37
clixxIO_a bridge is one approach, but my boards are so small that they need logic to be self contained05:38
clixxIO_but having a 'proxy' driver is also good05:39
clixxIO_which is the circuits.node over JSON idea05:39
clixxIO_a few people have written good proxy type controllers (serial controlled processor) - handy05:41
SXprologic, how to check if there were some errors in circuits?05:41
clixxIO_LED doesn't come on - lol05:41
SXoh! and how to run a single test?05:42
clixxIO_via a JSON socket client/server05:43
clixxIO_most things could be tested over the JSON bus05:43
prologicSX:  add Debugger() to your app05:45
prologiclisten to the "error" event05:45
prologicpy.test -x -s /path/to/test.py05:45
prologicclixxIO_:  yeah implanting logic is okay too05:45
prologicbut I think that should be done at your application level05:45
clixxIO_that's why I will need a comparable, if scaled down C+ implementation05:46
clixxIO_I'm just looking through some embedded processor code snippets - old school stuff05:53
clixxIO_I can see circuits working quite well in almost every situation05:53
clixxIO_It would give a tremendous improvement in code readability05:54
clixxIO_next question: what's the nearest competing event architecture?05:55
SXI need it for tests05:56
SXto test internal errors05:56
prologicnearest competing event architecture?05:57
prologicin Python?05:57
prologicI honestly don't know of one!05:57
prologiceverything else either uses Deferreds (Twisted)05:57
prologicor coroutines (gevent, eventlet, etc)05:58
prologiccircuits is quite unique05:58
prologicSX: py.test -x -s -v05:58
prologicthe test suite in circuits already adds in the Debugger() with the -v option05:58
clixxIO_I thought so06:03
clixxIO_ok - gotta run06:03
clixxIO_back tomorow06:03
*** clixxIO_ has quit IRC06:03
SXprologic, I fixed that bug with waitEvent, but I don't like that _on_done and _on_tick there do unregisterHandler internally06:06
prologicyou know what I think?06:09
prologicbrb phone06:09
prologicI think we should implement this handling of this in a separate core component06:10
prologicthe _on_done and _on_tick handlers that is06:10
prologicand make them part of every system by default06:10
prologicsort of like how we deal with FallbackErrorHandler06:10
prologicand FallbackGenerator06:11
prologiclike the .registerTask and .unregisterTask would remain06:11
prologicbut move the handlers out06:11
prologiclet's split this out and deal with it in a nicer way06:11
prologicthe circuits way :)06:11
SXhow about some better solution for tasks?06:12
SXnow it's just a simple generator06:13
SXand process task is kind of hardcode for all the supported operations06:14
SXlike callEvent06:14
prologicI think we should break it out06:19
prologicsplit it up06:19
prologicand generlize it06:19
prologicI competely agree06:19
prologiccreate an internal Task object06:19
prologicthat handles a lot of the hard coding we've done06:19
prologiccall/wait/task management in circuits is quite new06:19
prologicso it's time to refactor I think and make the internals better06:20
prologicand easier to understand :)06:20
SXand one more thing06:20
prologicit's essentially there for mixing in corroutines into the event loop06:20
prologicand so you have a synchronous layer of ontrol06:20
prologicover an underlying asynchronous core06:20
SXit's a bad think we should wait for the next tick when handler creates a new task in process of dispatch06:20
prologicexplain that in another way? :)06:21
SXwhen waitEvent's handler registers a task06:21
SXit's done in dispatcher's call06:21
prologicand we should change this to?06:22
SXand then if considers all work done and goes to sleep with FallBack06:22
SXbut the work is actually not done06:22
prologicyeah no06:22
prologicthis approach is fine though06:22
prologicthink about it06:22
prologicwork is done06:22
prologicthere is no more work to do06:22
SXnot exactly06:22
prologicbut there is a waiting event06:22
prologicor one or more06:22
prologichang on :)06:22
prologiclet me finish :)06:23
SXwe need to handle that tasks06:23
prologicwhen that waiting event finally completes06:23
SXin the current tick06:23
prologicit *should* break the wait06:23
prologicthere are internal mechanisms for this06:23
prologicto break the "long sleep"06:23
prologicfire does it I think06:23
prologicbut also what should do it is the completion of promises06:23
prologicbecause what you don't want to do is06:23
prologiccheck every x ms06:23
prologicthat's a no no in any event loop06:23
prologicyou want to only wakeup exactly at the mount you need to06:24
prologicand not sooner06:24
prologicthat's why the FallbackGenerator sleeps for so long06:24
prologicbut there are internals that break it's sleep06:24
SXyes, that's what I'm talking about. We should not wait, just do the job now (process tasks). And then go to sleep.06:24
SXCoz it's kinda breaks the idea of timeouts. we should report it NOW, not some time later.06:25
SXso yes, of course we should sleep as soon, as there's no job left06:26
SXbut before that we should handle everything left06:26
prologicso the timeout itself should be processed06:26
prologicand thrown "right now"06:26
prologicyou're saying?06:26
prologicgotcha! :)06:26
prologiclet's make that happen too06:26
SXit's not possible now06:26
prologicI agree06:26
SXwith current tasks06:26
prologicexceptions should be raised immediately as they occur06:26
prologicnot raised layer06:26
prologicit's only errors (uncaught exceptions) that are fired and captured as error() events06:27
prologicwhich is how it's always been in circuits06:27
prologicif you have bugs in your app06:27
prologicit won't crash horribly06:27
prologicbut you'll get error() events fired06:27
prologicI'm on holidays as of tomorrow06:27
prologicso maybe that's the first thing we should tackle06:27
SXyeah, that's why I'm not raising an exception, instead I'm making a task with ExceptionWrapper06:27
prologicif you're willing to help :)06:27
SXand handle it in process06:27
prologicdid you fix that bug I posted last night?06:28
prologicthere's some KeyError being thrown internally06:28
prologicfor the test code I had written up06:28
SXso no error, only if user's handler is not catching the exception.06:28
SXi'll commit it soon06:28
prologicsweet :)06:28
prologicok I'm outta here hsortly06:29
prologicanniversary dinner with the wife and daughter06:29
prologicso I'll bbl at home tonight06:29
SXhave a good time!06:29
*** qwebirc3729 has joined #circuits08:34
qwebirc3729hi,maybe just for the log, I wrote two days ago about troubels with Ctrl+C and Python 3.3 on Windows (it doesn't stop a running Manager). I switched back to Python 2.7 ( Python(x,y) version or WinPython ) and circuits just works :)09:13
qwebirc3729now I need to dig into circuits09:15
SXrun it with + Debugger()09:18
SX(App() + Debugger()).run()09:18
SXand look if curcuits receive a term signal09:18
qwebirc3729@+SX thanks for the hint, i will try it10:56
prologicqwebirc3729, hmm11:15
prologicqwebirc3729, could you help us identify the issue? :)11:16
prologicseems to be a Windows + Python3 problem11:16
prologicweird :)11:16
prologicwell the main event loop should really get and capture the KeyboardInterrupt11:16
prologicand sets up a signal hadnler for it11:16
ircnotifier2 commit(s) pushed to circuits-dev11:17
ircnotifier8903d58ef9fd by SimpleX: fix KeyError exception on callEvent with timeout set11:17
ircnotifier3ca402c650d4 by SimpleX: fix web.gzip and web.static tests11:17
*** SX has quit IRC11:46
*** SX has joined #circuits11:48
qwebirc3729prologic, I have to finish some stuff at work befor christmas, SX told me i should try it with Debugger(). I'm new to phyton and circuits but hope to help you as soon as possible...13:06
qwebirc3729prologic, I'm working on an bare metal embedded product, so im intressted in the stuff to communicate with the device. But working with python is a side project (I have to do it under the radar of my boss during work :b)13:11
qwebirc3729For the GUI part I like to use QT. Have you ever combined the Qt EventLoop/Signal-Slot with the circuits 'EventLoop'?13:15
*** SX has quit IRC13:41
qwebirc3729I tested it with the same WinPython-64bit- (Python 3.3.2) but i reinstalled circuits-dev (pip uninstall circuits , remove the src/circuits folder, pip install -e hg+ and now Ctrl+C works with python 3.3.2 in a IPython shell14:17
qwebirc3729so maybe my setup was wrong14:18
qwebirc3729Example Code:
*** qwebirc3729 has quit IRC15:06
*** qwebirc95686 has joined #circuits17:14
*** anunnaki has quit IRC17:17
*** qwebirc95686 has quit IRC17:47
*** Ossoleil has joined #circuits18:25
*** Ossoleil has quit IRC18:25
*** litzomatic has joined #circuits19:01
*** c45y has joined #circuits19:32
*** litzomatic has quit IRC19:44
*** c45y has quit IRC20:26
*** c45y has joined #circuits20:27
prologic<qwebirc3729> For the GUI part I like to use QT. Have you ever combined the Qt EventLoop/Signal-Slot with the circuits 'EventLoop'? <-- Not QT, but we have done so with pygame and gtk - so it's very possible :)20:50
*** c45y has quit IRC21:03
*** c45y has joined #circuits21:05
*** anunnaki has joined #circuits21:49
*** anunnaki has quit IRC21:53
*** anunnaki has joined #circuits21:55
*** anunnaki has quit IRC22:05
*** anunnaki has joined #circuits22:06
*** anunnaki has quit IRC22:06
*** anunnaki has joined #circuits22:08
*** realzies has quit IRC22:08
*** anunnaki has quit IRC22:10
*** anunnaki has joined #circuits22:12
*** realzies has joined #circuits22:28
*** anunnaki has quit IRC23:09
*** anunnaki has joined #circuits23:09
*** anunnaki has quit IRC23:36

Generated by 2.11.0 by Marius Gedminas - find it at!