chxj1992 / go-jsonrpc

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

go-jsonrpc

This is Golang Jsonrpc(v2) Package

Usage

  • Install Dependencies
  $ godep restore
  • Start Server
  $ go run demo/server.go
  • Run Tests (Client)
  $ go test -v demo/server_test.go

The graceful restart feature of server is based on endless. Check examples for more information.

Signals

The endless server will listen for the following signals: syscall.SIGHUP, syscall.SIGUSR1, syscall.SIGUSR2, syscall.SIGINT, syscall.SIGTERM, and syscall.SIGTSTP:

SIGHUP will trigger a fork/restart

syscall.SIGINT and syscall.SIGTERM will trigger a shutdown of the server (it will finish running requests)

SIGUSR2 will trigger hammerTime

SIGUSR1 and SIGTSTP are listened for but do not trigger anything in the endless server itself. (probably useless - might get rid of those two)

About


Languages

Language:Go 100.0%