LionOps

LionOps

Help with OTP and architectural design for a proxy MUD system

I’ve read the Mix & OTP section of the hex docs and semi-grok things. What I’m struggling with is how everything fits together in my use case, and advice/guidance is appreciated as I’m new to Elixir (and OTP).

I want to create a proxy system for a MUD. Normally, a mud client is used to make a telnet connection to a server; my system will sit in the middle acting as a pass-through while interpreting input from both the server and client.

There will only ever be one pair of connections, so at least for the socket management, I don’t need to worry about multiple simultaneous connections. (I think OTP will be useful for data processing where distribution makes sense.)

Using an umbrella project and wanting to have test coverage, does it make sense to have a telnet_client and telnet_server app? Combine them into a single proxy app? What OTP objects and strategies would you use?

Help is appreciated in how best to tackle this problem space and reason about it.

Marked As Solved

LostKobrakai

LostKobrakai

Deciding for multiple OTP applications should imo be made based on deployment circumstances and not code architecture decisions. There’s no real reason to go for multiple OTP applications if they don’t need to be independently deployed or shared between multiple systems – and things will be simpler if you have a single application. And you can always build the project in a way that spliting things up will be mostly moving files around and maybe a few search and replaces.

So unless you plan to deploy the server and client individually I’d suggest keeping things simple and put them in a single application – skip the umbrella.

As for what you’d use out of OTP’ish things I’d suggest looking at thousand_islands(/ranch) for the tcp server (with gen_tcp underneigh) and likely plain gen_tcp for the client side.

Also Liked

krasenyp

krasenyp

I’ve used umbrella applications both in personal projects, early in my career, and in professional setting. They’re almost never a good choice. I second Help with OTP and architectural design for a proxy MUD system - #2 by LostKobrakai.

Last Post!

krasenyp

krasenyp

I’ve used umbrella applications both in personal projects, early in my career, and in professional setting. They’re almost never a good choice. I second Help with OTP and architectural design for a proxy MUD system - #2 by LostKobrakai.

Where Next?

Popular in Questions Top

ovidiubadita
Hey all, I discovered Elixir and I love it. I always wanted to learn a functional programming and I intended to go for Haskell, but afte...
New
lanycrost
Hi everyone! I need implement if…else if…else condition from my elixir code, and anymore of this control flow structures not work proper...
New
mcarvalho
What is the difference between System.get_env and Application.get_env? For example, what are best practices to use one versus another.
New
joeerl
Hello again - after a longish gap I’ve decided I really must dig into Elixir and see what’s been happening here - so I have a few questio...
New
sen
Hi All, I set a environment variables in dev.exs , like below code. when i start server, how can i set the ${enable} value? thanks. d...
New
SoCreat
i’m a new one to elixir which editor can i use vs code? or atom? Thanks! :smiley:
New
dblack
I’ve got an issue with an app and I’ve no idea of how to troubleshoot it. I’m hoping someone here might have seen something similar. I p...
New

Other popular topics Top

baxterw3b
Hi guys, i’m new in the Elixir world, and i have to say, that i love it! i’m having some problem to understand anonymous functions with ...
New
Brian
What is the proper way to load a module from a file in to IEX? In the python world, doing something like this pretty standard: from ....
New
stefanchrobot
What’s the safe way to decode a JSON string into a struct? I want to avoid calling String.to_atom. Jason.decode can give me a map with st...
New
axelson
This post is a wiki (feel free to hit the edit button near the bottom right of this post to add your own changes!) This post collects co...
239 49084 226
New
romenigld
I am trying to run a deploy with docker and I successfully runned with this command: docker build -t romenigld/blog-prod . but when I t...
New
TunkShif
This post is an instruction guide to help you setup your Neovim for Elixir development from scratch. It includes general information on h...
274 42533 114
New

Latest on Elixir Forum

Elixir Forum

We're in Beta

About us Mission Statement