*** Osso_ has quit IRC | 01:57 | |
zildjian | prologic: thanks | 02:39 |
---|---|---|
prologic | zildjian: nps ;) | 02:50 |
*** zildjian has quit IRC | 08:16 | |
prologic | even' all | 08:24 |
Yama | hi prologic | 08:24 |
*** zildjian has joined #circuits | 08:26 | |
prologic | hi Yo | 09:10 |
prologic | hi Yama | 09:10 |
prologic | hi zildjian | 09:10 |
*** Osso_ has joined #circuits | 10:12 | |
*** Workster has quit IRC | 11:37 | |
*** Workster has joined #circuits | 11:37 | |
*** Workster has quit IRC | 11:37 | |
*** Workster has joined #circuits | 11:37 | |
*** blubberdiblub has quit IRC | 12:36 | |
*** blubberdiblub has joined #circuits | 12:39 | |
*** koobs has quit IRC | 12:54 | |
*** koobs has joined #circuits | 12:58 | |
*** An_Ony_Moose has quit IRC | 13:15 | |
*** An_Ony_Moose has joined #circuits | 13:16 | |
*** koobs has quit IRC | 13:25 | |
*** koobs has joined #circuits | 13:27 | |
*** koobs has quit IRC | 13:46 | |
*** koobs has joined #circuits | 13:47 | |
*** koobs has quit IRC | 14:10 | |
*** koobs has joined #circuits | 14:12 | |
Yama | hi | 15:16 |
*** qwebirc94532 has joined #circuits | 16:02 | |
*** qwebirc94532 has quit IRC | 16:02 | |
*** cfarmer has joined #circuits | 16:03 | |
cfarmer | Hi all, I’m wondering if someone can help me fugure out how to propagate a message through multiple Components (rather than all at once). Using the http://circuits.readthedocs.org/en/latest/tutorials/woof/index.html#component-channels example, how would I get Bob to woof at Fred who woudl then woof at Steve and so on? Apologies if this is obvious or not a good idea, I’m new to circuits and asynchronous programming in general… | 17:32 |
*** Osso_ has quit IRC | 18:47 | |
*** Osso_ has joined #circuits | 18:50 | |
*** edk has quit IRC | 19:50 | |
*** edk has joined #circuits | 19:57 | |
prologic | hi cfarmer | 20:16 |
prologic | morn'n all | 20:16 |
prologic | cfarmer, http://codepad.org/y6Mg3pSh | 20:24 |
prologic | I guess something like this maybe | 20:24 |
prologic | very contrived of course :) | 20:24 |
cfarmer | prologic: cool! that’s pretty much what i’m looking for… is it a common usecase to have ‘dynamic’ channels (e.g., the same component used in 4 different channels)? | 20:30 |
cfarmer | basically, i’m looking for something where i can implement asychronous signals and slots to pass around messages and fire actions based on said messages… circuits sounds like what i’m looking for, so now i’m just trying to figure out how to do it :-) | 20:32 |
cfarmer | prologic: I really like to clean API you have implmented… clean API means my code looks nice even when it isn’t ;-) | 20:33 |
prologic | common, no | 20:43 |
prologic | two sure :) | 20:43 |
prologic | e.g: a TCPServer and UDPServer in the same app/system | 20:44 |
prologic | or circuits.web plus various other components that are non-web | 20:44 |
prologic | signals and slots you ay? | 20:44 |
prologic | *say | 20:45 |
prologic | can I ask what more you are doing on top of circuits per say? | 20:46 |
prologic | one of the things I've learned over the year is that circuits and it's event-driven and component architecture lends itself to implementing all sorts of patterns | 20:47 |
prologic | "message passing" (or event-driven) as circuits is at it's core seems to be a good flexible core | 20:47 |
prologic | i.e: you could implement Actor on top of circuits | 20:47 |
prologic | Signals and Slots | 20:48 |
prologic | etc | 20:48 |
cfarmer | prologic: sure, i’m trying to implement a ‘streaming’ framework and am currently assessing options/alternatives. how it would (ideally) work: | 21:22 |
cfarmer | you have multiple ‘components’ each with a specific purpose, and you’d like to string them together: component A pulls from a json stream somwehere, component B takes each json object in turn and counts +1 if type == ‘cat’ and then emits the running count as each new json object is checked, which in turns tells another component to update update some other value or attribute... | 21:25 |
cfarmer | if no new json comes through the pipeline, nothing happens until something does | 21:25 |
cfarmer | the idea is to (dynamically) develop a workflow for processing ‘streaming data’ | 21:29 |
prologic | well okay sure | 21:39 |
prologic | and these source streams are coming from? | 21:39 |
prologic | ihmo you don't need to build a framework on top of circuits for this :) | 21:39 |
prologic | build a component that reads from your stream | 21:39 |
prologic | over circuits.web, some kine of rpc (we implement json-rpc, xmlrpc) or websockets or some kind of tcp/udp/unix stream | 21:40 |
prologic | build your other component that listens for the processed stream and adds one if type == "cat" | 21:40 |
prologic | and so on and so forth | 21:40 |
cfarmer | yes, this is what i was hoping for… for testing, i’ll probably just start with a component that generates a stream of random numbers… my current ‘issue’ is part about building a component that listens to aothe specific component… it seems more like things go the other way around (i.e., to fire to a specific component) which might not work as well once I start adding components along the line..? | 21:43 |
cfarmer | anyway, i obviously need to spend more time with circuits, but it does sound like it fits the bill nicelty | 21:43 |
prologic | I see | 21:45 |
prologic | so one of the important things behind circuits is it's designed for performance | 21:45 |
prologic | so whilst there are channels to separate components with similar events from each other | 21:46 |
prologic | all components can in theory listen to each other | 21:46 |
prologic | you've already familar with the channel setting | 21:46 |
prologic | class Foo(Component): | 21:46 |
prologic | channel = "foo" | 21:46 |
cfarmer | yes | 21:46 |
prologic | you can also define event handlers like: | 21:46 |
prologic | @handler("bar", channel="foo") | 21:47 |
prologic | and you can also fire events to specific channels | 21:47 |
prologic | e.g: | 21:47 |
prologic | self.fire(bar(), "foo") | 21:47 |
prologic | or multiple channels | 21:48 |
prologic | e.g: | 21:48 |
prologic | self.fire(bar(), "a", "b", "c") | 21:48 |
cfarmer | oooh right! i did see some of that… | 21:49 |
cfarmer | ok, very nice… i’m going to give this a go over the weekend and see where i get… again, i really like the simple API, so i was really hoping this would be what i was looking for ;-) | 21:49 |
*** Osso_ has quit IRC | 21:50 | |
prologic | cool :) | 21:50 |
prologic | let me know if I can clear anything else up | 21:50 |
prologic | :) | 21:50 |
cfarmer | cheers, thanks! | 22:03 |
*** Osso_ has joined #circuits | 22:38 | |
Yama | gn8 | 22:55 |
*** robert_|disconne has quit IRC | 23:40 | |
*** robert_|disconne has joined #circuits | 23:40 |
Generated by irclog2html.py 2.11.0 by Marius Gedminas - find it at mg.pov.lt!