Get clojrue projects to communicate with a server

So i have a project which generates a puzzles and solves it in separate classes using the REPL. Is there any way to separate those classes into separate projects so that I can create a server that is on the same machine and can find puzzles already generated and return them to the calling client (puzzle solver) without the use of web servers?

Update: initially misunderstood what i was trying to do and reworded my question.

You don’t need to use a web server, you can serve files over a socket using any protocol, and they don’t need to be exposed to the web. These cookbooks might help:

This SO answer too: https://stackoverflow.com/questions/25284724/socket-programming-in-clojure

That said, since you mentioned same machine, you don’t necessarily need to communicate over sockets. You can use any other type of IPC (https://en.wikipedia.org/wiki/Inter-process_communication)

For example, you could try using: https://github.com/caplogic/Mappedbus which uses shared memory and memory mapped files for IPC.

Or, the easiest form of IPC, is probably through Piping input and output.

These things are all a bit tricky and confusing, so good luck.

1 Like