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

Add call_loop and get_table_names #1375

Merged
merged 2 commits into from
Apr 6, 2021
Merged

Add call_loop and get_table_names #1375

merged 2 commits into from
Apr 6, 2021

Conversation

sc1f
Copy link
Contributor

@sc1f sc1f commented Apr 5, 2021

This PR adds two methods to the PerspectiveManager API:

call_loop(fn, *args, **kwargs): calls fn on the loop_callback of the manager, or raises a PerspectiveError if the loop callback is not set.

This allows users to make calls on the Perspective thread without having to deal with the _loop_callback property of the manager, which is ostensibly private but (until now) lacked a public API.

get_table_names(): Returns a list of the tables hosted on the manager by name.

A common use case is to query the managers' private _tables and _views dictionaries for users to find out which Tables/Views are hosted on a server, which is especially useful in a server-client context where the consumers of the Perspective server may be different than the author of the server. get_table_names() offers a public API that can be called without having to query private properties of PerspectiveManager.

@sc1f sc1f added enhancement Feature requests or improvements Python labels Apr 5, 2021
Copy link
Member

@texodus texodus left a comment

Choose a reason for hiding this comment

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

Looks good!

@texodus
Copy link
Member

texodus commented Apr 6, 2021

Thanks for the PR!

@texodus texodus merged commit 795f619 into master Apr 6, 2021
@texodus texodus deleted the call-loop branch April 6, 2021 05:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Feature requests or improvements Python
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants