[erlang-questions] how: perl <-> erlang
Wed Mar 5 07:23:16 CET 2008
Roessner, Silvester wrote:
> Hi Jeff,
> I have written a generic Erlang <-> Perl interface a year ago. It uses an Erlang port in binary mode. In that way I can handle all Erlang types and map them to Perl types. But that also means that Erlang has to start Perl, not vice versa.
> It's 80 % ready. I stopped working on it as I found an error in Erlang or Perl.
> If you like, Jeff, I can send you the code as is.
> Your posting has motivated me! I'll start to finish the interface this evening - yeah. Thank's for that!
> mit freundlichen Grüßen / with kind regards
The trouble with this approach is that Radiator is a third party product
(http://www.open.com.au/radiator/) which is started via an init.d
script. Making changes to this, while possible, would make it complicate
for future maintenance and support. Radiator official supports the use
of hook functions (controlled through the main config file) and custom
auth modules. We're currently using both of these.
The idea is that Radiator does the auth and acct, as it currently does,
then sends a message to an erlang node to notify it that the user has
logged on or off with the relevent details. The trick here is that as
far as I can tell Radiator is a single threaded perl process. The
AuthByGeneric module which is the parent object of all Auth modules
supports forking for each request, but this would be only for that phase
of the auth in chain of modules.
There is already an AuthBy SOAP module and I could do the calls though
that, but I was hoping for something a little lighter not to mention faster.
A couple of people have suggested
Someone else suggested I look at
which uses erl_call command. I thought this would be too slow may be I'm
wrong. I'll have to investigate this further. The best approach may be
to use the functions from Erlang/Port.pm to create a connection from
Radiator for every request, send request, await reply, disconnect.
Anyway, just something to keep in mind when your writting your own
stuff. let me know if you finish your interface I'll give it a go.
More information about the erlang-questions