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