This is the reference point. All the other options are based off this.
|-- app
| |-- controllers
| | |-- admin
| import org.apache.camel.Exchange | |
| class handler { | |
| public void gmh(Exchange exchange) { | |
| def props = exchange.getIn().getHeaders() | |
| def response = "<doc>" | |
| props.entrySet().each { | |
| response += "<header key='" + it.getKey() + "'>" + it.getValue() + "</header>" | |
| } | |
| response += "</doc>" | |
| exchange.getIn().setBody(response) |
| <route> | |
| <from uri="servlet:///gmh" /> | |
| <to uri="bean:gmh?method=gmh"/> | |
| <setHeader headerName="Content-Type"><simple>text/xml</simple></setHeader> | |
| </route> |
| // Use Gists to store code you would like to remember later on | |
| console.log(window); // log the "window" object to the console |
(by @andrestaltz)
So you're curious in learning this new thing called (Functional) Reactive Programming (FRP).
Learning it is hard, even harder by the lack of good material. When I started, I tried looking for tutorials. I found only a handful of practical guides, but they just scratched the surface and never tackled the challenge of building the whole architecture around it. Library documentations often don't help when you're trying to understand some function. I mean, honestly, look at this:
Rx.Observable.prototype.flatMapLatest(selector, [thisArg])
Projects each element of an observable sequence into a new sequence of observable sequences by incorporating the element's index and then transforms an observable sequence of observable sequences into an observable sequence producing values only from the most recent observable sequence.