Skip to content

Conversation

@pitrou
Copy link
Member

@pitrou pitrou commented Nov 15, 2016

As a bonus, serializing coroutines is now much faster and produces a smaller payload.

As a bonus, serializing coroutines is now much faster and produces a smaller
payload.
@mrocklin
Copy link
Member

The reason to avoid putting this into cloudpickle directly is that tornado is a bit of a special case?

@pitrou
Copy link
Member Author

pitrou commented Nov 15, 2016

I don't know, it depends on @rgbkrk's preference. The code involves a fair amount of hacks :-)

@mrocklin
Copy link
Member

I think that cloudpickle is entirely hacks. Also, there isn't really a single core maintainer of cloudpickle. It's a bunch of people like us that have some small amount of need for the project. You are about as likely to maintain cloudpickle in the future as anyone else.

@pitrou
Copy link
Member Author

pitrou commented Nov 15, 2016

Still, I don't have push access to cloudpickle, so the current maintainers would have to give their opinion whether they'd like to support this kind of code (possibly a bit more hackish, since we have to avoid importing tornado unconditionally in cloudpickle).

@mrocklin
Copy link
Member

cc @minrk @ogrisel . Do we want this code to support Tornado coroutines in cloudpickle?

Return whether *func* is a Tornado coroutine function.
Running coroutines are not supported.
"""
return func.__code__ is _tornado_coroutine_sample.__code__
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How reliable is this check? What sort of change in @gen.coroutine would break this is check?

Copy link
Member Author

@pitrou pitrou Nov 15, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would need gen.coroutine to return something else than a wrapper function. Apparently returning a wrapper function has been the case since the beginning, see tornadoweb/tornado@58b0dab

@minrk
Copy link
Contributor

minrk commented Nov 15, 2016

I'd be AOK with supporting tornado coroutines in cloudpickle if I were more confident in the detection of the coroutine (i.e. if tornadoweb/tornado#1890 is merged). I'd love it even more if tornado itself handled the pickle/unpickle of coroutines.

@mrocklin
Copy link
Member

cc @ajdavis

@pitrou
Copy link
Member Author

pitrou commented Nov 15, 2016

I'd be AOK with supporting tornado coroutines in cloudpickle if I were more confident in the detection of the coroutine (i.e. if tornadoweb/tornado#1890 is merged).

I can understand that. From distributed's point of view, if tornadoweb/tornado#1890 isn't merged before the Tornado 4.5 release, we'll need our own workaround.

@pitrou
Copy link
Member Author

pitrou commented Nov 20, 2016

On the good news front, tornadoweb/tornado#1890 has now been merged.

@rgbkrk
Copy link

rgbkrk commented Nov 20, 2016

Great news!

@pitrou
Copy link
Member Author

pitrou commented Nov 21, 2016

I've submitted cloudpipe/cloudpickle#69

@pitrou
Copy link
Member Author

pitrou commented Nov 21, 2016

This is superseded by the aforementioned cloudpickle PR. Closing.

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

Successfully merging this pull request may close these issues.

4 participants