IRC Logs for #circuits Thursday, 2016-10-06

*** JDallas has joined #circuits01:06
*** ke4roh has joined #circuits01:57
*** Coldblackice has joined #circuits02:05
*** Coldblackice has quit IRC02:06
*** ke4roh has quit IRC03:46
*** JDallas has quit IRC04:21
prologicriot: re websocket streaming. do you see any errors on the server-side?05:05
*** braoru has joined #circuits05:12
braoruhello :-)05:15
braoruI'm still here fighting with circuits (I don't give up easily :_))05:15
prologicdon't fight :)05:22
prologicit's a pretty easy to use framework05:22
prologicso you were saying success events take 30s to fire?05:22
prologicthat might be because the actual underlying event itself blocked for 30s05:22
prologicwhich is bad as you know :) if you have large blocking event handlers you really should start thinking about using Worker pools05:23
braorubut same for the workerpool05:38
braoruwhen rokler hit return05:38
braoruit's need 20-30s for the call to return05:38
braoruquite annoying :)05:39
braorubut it's certainly due to me I think.05:39
braoruis that normal there are no track of core.pool in the code ?05:49
prologichmm?06:01
prologicdo you have an example showing this?06:01
braoruhoo i see on the worker code whats it's done06:02
braoruhttps://pythonhosted.org/circuits/api/circuits.core.workers.html06:02
braoru"circuits.core.pools" but in fact it's just at the worker creation here : https://github.com/circuits/circuits/blob/b0df3dda60f1cc767a9ce921dbe1e77e880b7d81/circuits/core/workers.py#L6906:02
braoruthe idea is to build some kind of "task" systems .. I just need the first post to ensure me that everything started and return an id :) so I need like a simple transaction but it's blocking (within the event handler of the request)06:04
braorubut I think I just try to work as I would with an eventloop but it's not06:05
braoruI try to worker but can't spot why it's not starting https://gist.github.com/braoru/6cc3532444e77043806b74103203d4ec06:05
braoruwronf sample : https://gist.github.com/braoru/6cc3532444e77043806b74103203d4ec06:11
prologicokay two things06:17
prologicdon't run your app in thread mode06:17
prologicjust App().run()06:17
prologicand you're fireing a work() event?06:17
prologicyou should be fireing a task() event06:17
prologicalso what you're firing at is None06:18
prologicL5706:18
prologicsorry you are using task() :)06:18
prologicyou're on the right track anyway keep at it :)06:19
braoruif I fire a task I get06:21
braoru can only join an iterable :-)06:21
braoruhttps://gist.github.com/braoru/6cc3532444e77043806b74103203d4ec new one :-)06:22
prologicI need to see a traceback or some debug logs :)06:24
braoruhttps://gist.github.com/braoru/ffafe126118a9b5dcb11c5092f0c911f06:26
braoruif I replace the call by a fire (to be non blocking) i get the task event fired with nonde06:27
braorunone06:27
braorummh sorry sorry I think I see why06:27
prologicAhhh06:27
prologicDon't use JSONController :)06:28
prologicit clearly wasn't designed for this06:28
prologicyou'll have to do your own serialization06:28
prologicI recommend you do it as a filter on the response event06:28
prologicexample: https://github.com/circuits/circuits/blob/master/examples/web/jsonserializer.py06:28
prologictry to think (when writing circuits code) in terms of asynchronous events :)06:29
prologicfire and react :)06:29
braoruit's the goal06:30
braorubut what I need is just to deal with the first interaction06:30
braorulike creation a task (chain of event) and returning an id to be able to make query later06:30
braorubut then how you work with crud like task where you have to query something before responding ?06:30
prologicno you're on the right track :)06:31
prologicjust don't use JSONController06:31
prologicit was designed for more simple use-cases06:31
braorushould I use the BaseController ?06:33
prologicthat's probably safer06:38
prologicit doesn't do any magic :)06:38
prologicbe aware that circuits.web was hacked together from pieces of BaseHTTPServer (Python std. lib), CherryPy and other bits and pieces06:39
prologicso you may have to write your own dispatcher (maybe)06:39
prologicif you get too fancy :)06:39
prologicbut I did write the backend for http://ccav.terranova.org.au/ completely in circuits06:39
prologicwhich has a full RESTful API :)06:40
prologichttps://bitbucket.org/ccaih/ccav06:40
braoruhtx07:00
braoruthx07:00
braoruCurrently I use pykka actors when I have to deal with heavy-long running (require multiple messages) task. Would it be better to includre them in my components as I would with worker or to include a component within each of my actors ?07:03
braoruor both07:03
braoruor I could simply create and detroy small component on the fly. But I would like to avoid having "event_name" created on the fly to query a single instance07:05
braorubut first ... I have to make the basecontroller work and stopping sending 404 ..07:14
braoruok then .. a basic controller : https://gist.github.com/braoru/b05d55edfd23f81a29cff3155d3be927 but still get error when using call :) https://gist.github.com/braoru/4da77d1f093d1cb56e5538da476aa74307:23
riotprologic: no, not really. Even with the debugger running.09:06
riotprologic: i built a minimal testcase: https://github.com/ri0t/websocketdebugger09:07
braoruI have a new test : https://gist.github.com/braoru/ac3858e0208ab67967c1da9d192504b5 but ending up there .. https://gist.github.com/braoru/e093f13ba7271364e9d23640d87f0dc3 I don't know why MyController does not have request member anymore if I use a call09:13
braoruwithin the POST handler09:13
braoruthere should be a way to make the controller part non-blocking with some kind of coroutine like approach09:42
braorumy problem seem to be a request_value_changed fired from I don't know where ..09:46
*** ke4roh has joined #circuits12:36
*** ke4roh_ has joined #circuits13:00
*** ke4roh has quit IRC13:03
braoruok14:25
braorumy sample with pykka actors referencing a part the the composed centra APP component seem to work :)14:26
braoruactors can react to event by translating them to message and actors can send event14:26
braoruprologic, tomorrow I clean a little bit my sample and I post it here to get some reviews .. (it's not clean but at least it's a first working poc :))14:28
*** dongge has joined #circuits14:38
*** braoru has quit IRC14:39
*** ke4roh__ has joined #circuits14:45
*** ke4roh_ has quit IRC14:48
prologicriot: are there any hints in the debug log output as to what's going on with the stream?14:55
*** dongge has quit IRC15:20
*** jgiorgi has joined #circuits15:22
*** Coldblackice has joined #circuits15:38
riotprologic: have a look: http://pastebin.com/a2ELKcrf15:46
riotprologic: if you have a few minutes, i suggest grabbing the debugging-tool, its got no deps, except circuits15:46
*** ke4roh__ has quit IRC20:54
*** ke4roh__ has joined #circuits23:51

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