Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/bhou/mimosarepl
https://github.com/bhou/mimosarepl
Last synced: about 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/bhou/mimosarepl
- Owner: bhou
- Created: 2013-11-21T23:42:36.000Z (about 11 years ago)
- Default Branch: master
- Last Pushed: 2013-11-24T12:27:26.000Z (about 11 years ago)
- Last Synced: 2024-04-15T00:16:51.533Z (9 months ago)
- Language: Java
- Size: 270 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
MimosaREPL
==========MimosaREPL is a java implemented lua REPL lib
### How to use it
####Server side
`````java
LuaService service = new LuaService(); // create a lua service
CommandFactory.setLuaService(service); // set the lua service to command factory
Thread thread = new Thread(new MimosaReplServer()); // start mimosa repl server
thread.start();
`````####Client side
`````java
MimosaReplClient client = new MimosaReplClient("localhost", 3333);
client.addHandler("--run:", new ResultHandler() {
@Override
public void handle(String message) {
System.out.println(message);
}
});
Thread thread = new Thread(client);
thread.start();String line = "print('hello')";
client.send("--run:\n" + line);`````
The basic command is RunCommand: it sends any lua code to server, run it, and send the result back. You should create
your RunCmdHandler to hadnle the result. (show it on the ui, post-processing, etc)