MCPcopy Index your code
hub / github.com/gopherdata/gophernotes / recvIOSub

Method recvIOSub

kernel_test.go:433–460  ·  view source on GitHub ↗

recvIOSub tries to read a published message from the IOPub channel. It will timeout after the given timeout delay. Upon error or timeout, recvIOSub will Fail the test.

(t *testing.T, timeout time.Duration)

Source from the content-addressed store, hash-verified

431// recvIOSub tries to read a published message from the IOPub channel. It will timeout after the given
432// timeout delay. Upon error or timeout, recvIOSub will Fail the test.
433func (client *testJupyterClient) recvIOSub(t *testing.T, timeout time.Duration) ComposedMsg {
434 t.Helper()
435
436 ch := make(chan ComposedMsg)
437
438 go func() {
439 repMsgParts, err := client.ioSocket.Recv()
440 if err != nil {
441 t.Fatalf("\t%s IOPub socket RecvMessageBytes: %s", failure, err)
442 }
443
444 msgParsed, _, err := WireMsgToComposedMsg(repMsgParts.Frames, []byte(connectionKey))
445 if err != nil {
446 t.Fatalf("\t%s Could not parse wire message: %s", failure, err)
447 }
448
449 ch <- msgParsed
450 }()
451
452 var sub ComposedMsg
453 select {
454 case sub = <-ch:
455 case <-time.After(timeout):
456 t.Fatalf("\t%s recvIOSub timed out", failure)
457 }
458
459 return sub
460}
461
462// performJupyterRequest preforms a request and awaits a reply on the shell channel. Additionally all messages on the
463// IOPub channel between the opening 'busy' messages and closing 'idle' message are captured and returned. The request

Callers 1

performJupyterRequestMethod · 0.95

Calls 1

WireMsgToComposedMsgFunction · 0.85

Tested by

no test coverage detected