[erlang-questions] Unidirectional architectures in Erlang

Rodrigo Stevaux roehst@REDACTED
Thu Aug 30 19:50:25 CEST 2018


Hi,

If I may ask, I have a question about actor-based systems design that arose
while writing a simple system for integrating GitHub and Slack.

GitHub events are sent to a server using their Webhook API. We do some
application logic on the events, and forward them to Slack.

So our architecture is unidirectional: messages are followed from the HTTP
server to a sequence of processes until they finally get to a message
dispatcher process that sends messages to Slack.

Message comes in, logic applies, message goes out.
The generic servers are very easy to test in a pure fashion: just test the
return values of handle_call for a given state.

But:
- unit testing should test that the unit under test forwards a message to a
given address (and that is not reflected on the handle_call return value)
- doing the integration testing of a "pipeline" of process involves testing
that ultimately a message gets to the last process.

Given the maturity of Erlang, I'd expect to promptly find solutions to this
case.

I haven't found a nice solution yet, so I suppose I am using OTP in a wrong
way (maybe it's not a good fit for my project), or I am choosing the wrong
architecture, or that I am missing key knowledge about how to test things
in Erlang.

Can anyone shed some light on this questions? Thanks in advance!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20180830/01107207/attachment.htm>


More information about the erlang-questions mailing list