Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

echokernel example does not include topic in 'stream' responses #69

Open
erickt opened this issue Oct 22, 2015 · 1 comment
Open

echokernel example does not include topic in 'stream' responses #69

erickt opened this issue Oct 22, 2015 · 1 comment

Comments

@erickt
Copy link

erickt commented Oct 22, 2015

I believe there is a bug in the echokernel example kernel, specifically:

        if not silent:
            stream_content = {'name': 'stdout', 'text': code}
            self.send_response(self.iopub_socket, 'stream', stream_content)

This is sending a message across the PUBSUB iopub_socket, but it doesn't include an identity argument, so there is no PUBSUB being prefixed to the message. The fix seems to be:

        if not silent:
            stream_content = {'name': 'stdout', 'text': code}
            self.send_response(self.iopub_socket, 'stream', stream_content, ident=self._topic('stream'))

But I'm a tad hesitant to put it in a pull request because it seems intentional to make the _topic private. Does anyone know the right way to fix this?

@takluyver
Copy link
Member

Hmm, I think the topics thing is new since I added the wrapper kernels machinery.

Maybe send_response should do something like:

if (ident is None) and (stream is self.iopub_socket):
    ident = self._topic(msg_type)

Or maybe there should be a separate send_iopub method that takes care of that.

@minrk?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants