@@ -16,7 +16,7 @@ import (
1616 "sync"
1717 "time"
1818
19- zmq "github.com/go-zeromq/zmq4"
19+ "github.com/go-zeromq/zmq4"
2020 "golang.org/x/xerrors"
2121
2222 "github.com/cosmos72/gomacro/ast2"
@@ -48,7 +48,7 @@ type ConnectionInfo struct {
4848
4949// Socket wraps a zmq socket with a lock which should be used to control write access.
5050type Socket struct {
51- Socket zmq .Socket
51+ Socket zmq4 .Socket
5252 Lock * sync.Mutex
5353}
5454
@@ -102,7 +102,7 @@ const (
102102)
103103
104104// RunWithSocket invokes the `run` function after acquiring the `Socket.Lock` and releases the lock when done.
105- func (s * Socket ) RunWithSocket (run func (socket zmq .Socket ) error ) error {
105+ func (s * Socket ) RunWithSocket (run func (socket zmq4 .Socket ) error ) error {
106106 s .Lock .Lock ()
107107 defer s .Lock .Unlock ()
108108 return run (s .Socket )
@@ -164,7 +164,7 @@ func runKernel(connectionFile string) {
164164 // TODO gracefully shutdown the heartbeat handler on kernel shutdown by closing the chan returned by startHeartbeat.
165165
166166 type msgType struct {
167- Msg zmq .Msg
167+ Msg zmq4 .Msg
168168 Err error
169169 }
170170
@@ -176,7 +176,7 @@ func runKernel(connectionFile string) {
176176 )
177177
178178 defer close (quit )
179- poll := func (msgs chan msgType , sck zmq .Socket ) {
179+ poll := func (msgs chan msgType , sck zmq4 .Socket ) {
180180 defer close (msgs )
181181 for {
182182 msg , err := sck .Recv ()
@@ -250,27 +250,27 @@ func prepareSockets(connInfo ConnectionInfo) (SocketGroup, error) {
250250
251251 // Create the shell socket, a request-reply socket that may receive messages from multiple frontend for
252252 // code execution, introspection, auto-completion, etc.
253- sg .ShellSocket .Socket = zmq .NewRouter (ctx )
253+ sg .ShellSocket .Socket = zmq4 .NewRouter (ctx )
254254 sg .ShellSocket .Lock = & sync.Mutex {}
255255
256256 // Create the control socket. This socket is a duplicate of the shell socket where messages on this channel
257257 // should jump ahead of queued messages on the shell socket.
258- sg .ControlSocket .Socket = zmq .NewRouter (ctx )
258+ sg .ControlSocket .Socket = zmq4 .NewRouter (ctx )
259259 sg .ControlSocket .Lock = & sync.Mutex {}
260260
261261 // Create the stdin socket, a request-reply socket used to request user input from a front-end. This is analogous
262262 // to a standard input stream.
263- sg .StdinSocket .Socket = zmq .NewRouter (ctx )
263+ sg .StdinSocket .Socket = zmq4 .NewRouter (ctx )
264264 sg .StdinSocket .Lock = & sync.Mutex {}
265265
266266 // Create the iopub socket, a publisher for broadcasting data like stdout/stderr output, displaying execution
267267 // results or errors, kernel status, etc. to connected subscribers.
268- sg .IOPubSocket .Socket = zmq .NewPub (ctx )
268+ sg .IOPubSocket .Socket = zmq4 .NewPub (ctx )
269269 sg .IOPubSocket .Lock = & sync.Mutex {}
270270
271271 // Create the heartbeat socket, a request-reply socket that only allows alternating recv-send (request-reply)
272272 // calls. It should echo the byte strings it receives to let the requester know the kernel is still alive.
273- sg .HBSocket .Socket = zmq .NewRep (ctx )
273+ sg .HBSocket .Socket = zmq4 .NewRep (ctx )
274274 sg .HBSocket .Lock = & sync.Mutex {}
275275
276276 // Bind the sockets.
@@ -575,7 +575,7 @@ func startHeartbeat(hbSocket Socket, wg *sync.WaitGroup) (shutdown chan struct{}
575575 defer wg .Done ()
576576
577577 type msgType struct {
578- Msg zmq .Msg
578+ Msg zmq4 .Msg
579579 Err error
580580 }
581581
@@ -604,7 +604,7 @@ func startHeartbeat(hbSocket Socket, wg *sync.WaitGroup) (shutdown chan struct{}
604604 case <- timeout .C :
605605 continue
606606 case v := <- msgs :
607- hbSocket .RunWithSocket (func (echo zmq .Socket ) error {
607+ hbSocket .RunWithSocket (func (echo zmq4 .Socket ) error {
608608 if v .Err != nil {
609609 log .Fatalf ("Error reading heartbeat ping bytes: %v\n " , v .Err )
610610 return v .Err
0 commit comments