On Mon, Feb 13, 2012 at 6:48 PM, Vladimir Sibirov
<trust...@kodigy.com> wrote:
> I'm glad to announce GoFlow package:
> https://github.com/trustmaster/goflow
I had a quick during my way back home on the train: looks very nice
and I might test it at some point for my app.
one thing I am not sure GoFlow can handle (at least from my quick
eyeballing of the doc and code) is the following use case:
- a PointsProducer process produces Point{x,y} structs and send them
on its Out port,
- a XMeanConsumer takes the Point{} from its In port to calculate the
running mean of this stream of Points,
- a YMeanConsumer takes the Point{} from its In port to calculate the
running mean of this stream of Points,
- you want each of the {X,Y}MeanConsumer processes to consume the
'same' stream of Points.
how do you handle this w/o sprinkling too much plumbing in users' code ?
I suspect this should be handled by the Graph component but I couldn't
find any kind of "repetitor" nor "broadcaster"...
-s
On Tue, 14 Feb 2012 14:05:21 +0400, Vladimir Sibirov <trust...@kodigy.com> wrote:
> A generic replicator would be a more elegant solution, but it would have to
> operate on channels of interface{} type. This means that it has to be
> connected to channels of interface{} type too and components which connect
> to replicator would have to use type assertions. Which is not very elegant.
> The same problem exists for other generic components, e.g. packet
> counters.
right. another usecase for generics, I suppose.
although, in your case, automatically generating stub components with
the correct number of in/out ports with the correct channel type, and
then automatically inserting them at the adequate network vertices,
shouldn't be a big issue.
(that's what I do in my pie-in-the-sky "framework". the automated code
generation part, that is.)
-s
--
#########################################
# Dr. Sebastien Binet
# Laboratoire de l'Accelerateur Lineaire
# Universite Paris-Sud XI
# Batiment 200
# 91898 Orsay
#########################################
for instance instead of:
"Runs the network by starting all of its processes."
you'd write
"RunNet runs the network by starting all of its processes."
it makes everything read so much more nicely.
Did you mean "single output cannot be connected to multiple intputs" ?
Automation programming looks somehow similar to FBP, I guess. Like GUI
programming, it is based on a cycle. The main difference is the things
that actually do events (actuators) or inform on them (sensors) are pure
hardware; thus, as expected, automation reaches very high levels of
reliability for extremely complex machines.
Typically, sections of programms read relevant inputs, process, set
outputs (i/o is updatedby the framework between cycle loops).
Sebastien's example would be directly written as is in automatics.
Inputs are just available, any part of the program reads them as needed.
The point of difference, i guess, may be that inputs and outputs are
indeed targeted, but to hardware components, not software (they are I/O
cards ;-), interfaces between hardware and software in both directions).
If I understand correctly, in FBP outputting info is targetting it to a
given receiver, so to say through a private port, thus also preventing
others to read it. Right? If yes, why? Why don't emitters just let info
available? (I'm sure there are good answers about program correction,
consistency, reliability and such...)
Denis
PS: I am rather sure for a while already that general-purpose
programming would highly benefit to study the "paradigm" of automation.
sure, one cannot make software be hardwere; but we can take inspiration
from what defines hardware and makes it different (read: incredibly
reliable compared to the state of the art in programming) to model a way
to design our components, and (even more important?) how they relate to
each other --I mean physically.
Indeed, when using a WaitGroup you should always increment the count
before you've spawned the goroutine in question to ensure correct
synchronization. Good catch!
- Jim
--
You received this message because you are subscribed to a topic in the Google Groups "golang-nuts" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/golang-nuts/bJOf8cwHfy8/unsubscribe.
To unsubscribe from this group and all its topics, send an email to golang-nuts...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
I haven't announced it yet, but GoFlow now also supports loading network definitions in NoFlo JSON format which you can draw with the latest version of JPM's DrawFBP tool. I just need a few peaceful days to update the docs and polish the code a bit. And then we can proceed to getting onboard of NoFlo-UI.
-- Developer at www.uppmax.uu.se/uppnex / www.farmbio.uu.se / rilpartner.se G: http://google.com/+samuellampa B: http://saml.rilspace.org T: http://twitter.com/smllmp