passing events from erlang to Clojure
I'm looking for a way to pass events back and forth between Clojure and erlang.
- has someone done this before?
- how should I encode the (immutable) messages in a flaxable general way?
- Should IPC be used for this? what sort?
- where 开发者_如何学运维has this gone wrong for you in the past?
You could use jinterface from clojure and be able to act as an Erlang node and send out multiple Pids associated with your node, in the Erlang cluster.
You've got lots of options as long as you use a socket (e.g. TCP/IP).
- Have you considered JSON?
- XML?
I can't say I've done Clojure <--> Erlang bridges before but "talking" to Erlang in JSON/XML is sufficiently painless.
Of course you can use the erl_interface
(binary exchange protocol) but then you'll need (probably unless there is a lib for this) to craft a marshaller for this in Clojure.
精彩评论