[erlang-questions] Tutorial (Erlang / Python)

Walter Weinmann walter.weinmann@REDACTED
Wed Sep 13 09:29:45 CEST 2017


Hi Craig, thanks for the answer.

I have a repository in Github
<https://github.com/walter-weinmann/erlang_thrift_tutorial> with the
complete test environment based on the Erlang and Python examples from the
Thrift tutorial. Of course, the corresponding program parts were also
generated by the Thrift compiler. The Python server is also ok and can be
reached via the Python client. The Erlang server can be accessed via both
clients (Erlang and Python). Only the connection from the Erlang Client to
the Python server is not established. Of course, it's the kind of
connection I need first.

Apache Thrift sounds really good, as it theoretically connects a lot of
platforms.

On 13 September 2017 at 09:07, zxq9 <zxq9@REDACTED> wrote:

> On 2017年09月13日 水曜日 08:42:27 Walter Weinmann wrote:
> > What is the idea behind the examples in the tutorial? Should these be
> > executable or are they just non-executable program code patterns. I want
> to
> > use Apache Thrift to connect Erlang and Python, but I am struggling with
> > connection problems from Erlang Client to Python Server (see THRIFT-4312
> > <https://issues.apache.org/jira/browse/THRIFT-4312> or Apache Thrift
> > mailing list
> > <http://mail-archives.apache.org/mod_mbox/thrift-user/201709.mbox/
> <CACe_jXefCS6pR-6YoZ6nMNU4y89KDiu2cnFi3dj6k%2BPpGaBrfQ%40mail.gmail.com>>)
> .
> > Since the community is very quiet here, I'm afraid this is a much too
> > exotic combination for Apache Thrift. Any comments?
>
> I'm not familiar with Apache Thrift. Normally when I want Python and
> Erlang to talk to one another I use BERT over a socket (usually network
> socket, but anything works). But that is just old-fashioned socket
> programming.
>
> Looking at the docs for Thrift[1] it looks like there is supposed to be
> something like a Thrift compiler that builds an Erlang (and Python and
> whatever else) module for you that you should be invoking. I assume that is
> the `thrift_client` module you are invoking in your program.
>
> The error you are seeing there with {error, econnrefused} is a normal TCP
> network error, not a specific Thrift/Erlang problem -- so check that the
> service you're trying to connect to is running and the port you're trying
> to contact is open.
>
> It seems very odd that the return value of `thrift_client:call/2` is being
> assigned to `Client1,2,3`. Are you sure the return value is supposed to
> look like this? Once you get the network problem sorted out, give that part
> a look -- I imagine that's actually supposed to always match the original
> Client (so that maybe you could open several connections at once, and match
> on them in a larger `receive` or `case` clause.
>
> -Craig
>
> [1] It looks like your formatting for Jira got sort of crazy at some
> point, so its a little hard to tell how things were supposed to be
> formatted. Pasting your example in a paste bin or here in the mailing list
> could be helpful.
> _______________________________________________
> erlang-questions mailing list
> erlang-questions@REDACTED
> http://erlang.org/mailman/listinfo/erlang-questions
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20170913/087c07d2/attachment.htm>


More information about the erlang-questions mailing list