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

Implement a new Async Server approach based on pyzmq to get completions on the Editor #3049

Merged
merged 8 commits into from
Mar 13, 2016

Conversation

blink1073
Copy link
Contributor

Implements streamlined async server for introspection, fixes #3033, fixes #3041.

Uses a single port for communication that is managed by zmq.
Uses socket notification rather than a thread in the client.
Adds a heartbeat to keep the server alive.
The main classes will be moved elsewhere and used for code analysis background tasks after beta3.

@ccordoba12
Copy link
Member

@blink1073, thanks a lot for working on this. I'd like to know what you mean by

partially address #3033

What's left to be done to solve that issue?


Also, please add pyzmq to our setup.py, conda recipe and README file, to reflect that now it is a first class dependency (instead of being inherited through qtconsole).

@blink1073
Copy link
Contributor Author

@ccordoba12, I'll close the other issue with this and make a new one specific to analysis tasks for clarity.

@ccordoba12
Copy link
Member

Ok, nice! Please remember that this PR also fixes #3041 :-)

@ccordoba12
Copy link
Member

And sorry for the confusion, I thought #3033 == #3041, so I was a bit worried that something was missing to fix #3041 (which is a serious issue).

@blink1073
Copy link
Contributor Author

@ccordoba12, done on all counts.

# Set up the heartbeat timer.
self.timer = QTimer(self)
self.timer.timeout.connect(self._heartbeat)
self.timer.start(HEATBEAT)
Copy link
Member

Choose a reason for hiding this comment

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

heatbeat? is that a new ryrthm?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@blink1073
Copy link
Contributor Author

I verified this works on Windows 7.

@@ -139,17 +139,18 @@ a Python version greater than 2.7 (Python 3.2 is not supported anymore).
* **Python** 2.7 or 3.3+
* **PyQt5** 5.2+ or **PyQt4** 4.6+: PyQt5 is recommended.
* **qtconsole**: Enhanced Python interpreter.
* **Rope** and **Jedi**: Editor code completion, calltips
* **Rope** and **Jedi**: Editor code completion, calltips.
Copy link
Member

Choose a reason for hiding this comment

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

There's no need to put a dot at the end here. Please notice that the text continues in the next line :-)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed.

@ccordoba12
Copy link
Member

This is working very nice, thanks @blink1073!

I'm just getting this error in the internal console after a completion request is performed and succeeds:

Traceback (most recent call last):
  File "/home/carlos/miniconda/envs/test-async/lib/python2.7/site-packages/spyderlib/utils/introspection/manager.py", line 125, in handle_response
    self._finalize(response)
  File "/home/carlos/miniconda/envs/test-async/lib/python2.7/site-packages/spyderlib/utils/introspection/manager.py", line 137, in _finalize
    % (self.info.name, response['name'],
AttributeError: 'NoneType' object has no attribute 'name'

This happens on Linux, with PyQ4 and PyQt5, and Python 2.7

@blink1073
Copy link
Contributor Author

Does the latest push address the error?

@ccordoba12
Copy link
Member

Yes, it does. But now there's a problem when I start Spyder with SPYDER_DEBUG=3: it frozes after the main window is created. Before your last change, it didn't happen that.

Could you verify it in your side?

@blink1073
Copy link
Contributor Author

Couldn't verify, but tried another fix, care to try again?

@ccordoba12
Copy link
Member

Thanks, your last commit fixes the freeze I was seeing. So, as soon as Travis and AppVeyor are green, I'll merge ;-)

@ccordoba12 ccordoba12 changed the title New Async Server Implement a new Async Server approach based on pyzmq to get completions from the Editor Mar 13, 2016
@ccordoba12 ccordoba12 changed the title Implement a new Async Server approach based on pyzmq to get completions from the Editor Implement a new Async Server approach based on pyzmq to get completions on the Editor Mar 13, 2016
ccordoba12 added a commit that referenced this pull request Mar 13, 2016
Implement a new Async Server approach based on pyzmq to get completions on the Editor
@ccordoba12 ccordoba12 merged commit 5b3c5a7 into spyder-ide:master Mar 13, 2016
@blink1073 blink1073 deleted the async-server branch March 19, 2016 15:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Spyder crash with "too many files open" message Create a Remote Procedure Call helper
3 participants