- The following commands are supported
CONNECTPINGSUBPUBUNSUB
- First clone the project
https://github.com/melsonic/gNats-Server.git && cd gNats-Server
- Run the project
make
- If you have Docker installed, you can also run it as a Docker container.
docker compose up
- After the Application is up and running, it's time to test the application
- Run
telnet localhost 4222to connect a client to the server
- Run
conn.Read()returnsio.EOFwhen client signals graceful end of input i.e no more reading. Not closing the connection onio.EOFwill result into infinite loop(infinite zero byte reading from the pipe)INFO{}should sendpayload, else by default it sends 0 & results inmaximum payload exceeded error.zero allocation byte parserparsing method- It can be used to optimize storage. Normally, storage is required to store
the parsed tokens. But in this method the parser changes
stateand based on current state and next byte, it takes relevant actions.
- It can be used to optimize storage. Normally, storage is required to store
the parsed tokens. But in this method the parser changes
nats benchsendsCONNECT {"verbose":false,...}, so the application needs to parse this verbose arg in order to determine weather to send+OKresponse or not. If the application sends+OKwithnats bench, it will result into the following errorExpected PONG, got +OK.- While dockerizing the application, I faced an error
$GOPATH/go.mod exist but should not, which was due to the fact that ingolangimage, the default workdir($HOME/go) is same as$GO_PATH($HOME/go). So, it is required to change theWORKDIRin the first place while building the image.
- Write Tests
- Support string subjectId (currently supports only integer subject id)
- Optimize Unsub Handler (change
[]chan stringtomap[chan]insubSubscribers map[int][]chan stringfor easier removal)

