| | |
| | | Close() |
| | | } |
| | | |
| | | // NewPush create listener args presentive for parameter with protocal, e.g. sub topic |
| | | func NewPush(m Mode, url string, args ...interface{}) Deliver { |
| | | // NewServer create listener args presentive for parameter with protocal, e.g. sub topic |
| | | func NewServer(m Mode, url string, args ...interface{}) Deliver { |
| | | |
| | | if m > ModeStart && m < ModeNNG { |
| | | return nngPush(m, url, args...) |
| | | return nngServer(m, url, args...) |
| | | } |
| | | return nil |
| | | } |
| | | |
| | | // NewPull create dialer args presentive for parameter with protocal, e.g. sub topic |
| | | func NewPull(m Mode, url string, args ...interface{}) Deliver { |
| | | // NewClient create dialer args presentive for parameter with protocal, e.g. sub topic |
| | | func NewClient(m Mode, url string, args ...interface{}) Deliver { |
| | | |
| | | if m > ModeStart && m < ModeNNG { |
| | | return nngPull(m, url, args...) |
| | | return nngClient(m, url, args...) |
| | | } |
| | | |
| | | return nil |
| | |
| | | } |
| | | } |
| | | |
| | | func nngPush(m Mode, url string, args ...interface{}) *NNG { |
| | | func nngServer(m Mode, url string, args ...interface{}) *NNG { |
| | | |
| | | rmExistedIpcName(url) |
| | | if sock, err := newSocket(protoProducer(m)); err == nil { |
| | |
| | | return nil |
| | | } |
| | | |
| | | func nngPull(m Mode, url string, args ...interface{}) *NNG { |
| | | func nngClient(m Mode, url string, args ...interface{}) *NNG { |
| | | |
| | | if sock, err := newSocket(protoConsumer(m)); err == nil { |
| | | if err = setSocketOptions(sock, args); err != nil { |