added close
parent
284cc4eb1a
commit
23d1d9dd1d
|
@ -95,6 +95,15 @@ func (p *PSCli) Read(i interface{}) error {
|
|||
return json.Unmarshal(bs, i)
|
||||
}
|
||||
|
||||
func (p *PSCli) Close() error {
|
||||
if !p.closed {
|
||||
p.closed = true
|
||||
close(p.ch)
|
||||
return p.con.Close()
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func NewCli(q string) (*PSCli, error) {
|
||||
ret := &PSCli{}
|
||||
ret.q = q
|
||||
|
|
Loading…
Reference in New Issue