<div dir="ltr">Hi,<div><br></div><div>I don't know anything about `ei` but we recently wrote an AMQP 1.0 client in erlang [1]. It isn't 100% complete and is unlikely to provide the kind of performance you may be expecting given you are looking at the internals of the runtime itself but it works and it covers the subset of functionality required for RabbitMQ projects. We have done basic testing against QPid.</div><div><br></div><div>[1] <a href="https://github.com/rabbitmq/rabbitmq-amqp1.0-client">https://github.com/rabbitmq/rabbitmq-amqp1.0-client</a></div><div><br></div><div>Cheers</div><div>Karl<br><br><div class="gmail_quote"><div dir="ltr">On Thu, 22 Jun 2017 at 08:33 Rick van Rein <<a href="mailto:rick@openfortress.nl">rick@openfortress.nl</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hello,<br>
<br>
I have looked at the ei module, both documentation and code. It looks<br>
quite efficient, but I am missing something, and I wonder if it is<br>
somewhere else.<br>
<br>
I started a discussion in the Apache Qpid user forum about integration<br>
their AMQP 1.0 API with Erlang; there does not seem to be a way of<br>
getting to AMQP 1.0 from Erlang, and given that both are designed for<br>
rock-solid software construction that would be a useful marriage. And<br>
the Go port has a variant API named "electron" that is aimed at<br>
"synchronous" communication under the assumption of many small processes.<br>
<br>
Having to pass a (very) large message into Erlang, and possibly out at<br>
the other end, requires cloning the entire binary over ei, AFAIK.<br>
Although Erlang is rumoured to internally use malloc() for binaries,<br>
with refcounting and parts pointing there (no doubt charging the<br>
refcount) this functionality (shared memory allocation, sharing parts,<br>
unsharing) does not seem to be available externally. Nor did I find a<br>
way of exchanging shared memory and parts over ei. Did I miss it? It<br>
would improve efficiency in applications where Erlang is on the sending<br>
or receiving end of AMQP, as well as an intermediate in the pathway.<br>
<br>
There is one more use of such an ei facility -- and that is where an<br>
existing parser in C is asked to decipher a block of text (like SIP,<br>
XML, ...) or binary (AMQP, DNS, OpenPGP, ...) and return parts thereof<br>
as components to work on. It's a pitty to have to copy in both<br>
directions, rather than using an existing malloc() and simply pointing<br>
into it.<br>
<br>
Are such facilities available but have I missed them?<br>
<br>
Cheers,<br>
-Rick<br>
<br>
_______________________________________________<br>
erlang-questions mailing list<br>
<a href="mailto:erlang-questions@erlang.org" target="_blank">erlang-questions@erlang.org</a><br>
<a href="http://erlang.org/mailman/listinfo/erlang-questions" rel="noreferrer" target="_blank">http://erlang.org/mailman/listinfo/erlang-questions</a><br>
</blockquote></div></div></div>