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

Reconsider proxy system #22

Open
leonhard-s opened this issue Sep 13, 2020 · 2 comments
Open

Reconsider proxy system #22

leonhard-s opened this issue Sep 13, 2020 · 2 comments
Labels
discussion Additional opinions wanted enhancement New feature or request prio:normal No immediate action required

Comments

@leonhard-s
Copy link
Owner

The current placeholder proxy objects work, but do not supported nested operations. It'd be very neat if they did.

Example for such a currently unsupported interface:

outfit = await ps2.Outfit.get_by_tag('<your_tag_here>', client=auraxium.Client())

# This is now a proxy object, awaiting it would return a list of OutfitMember instances
members = outfit.members()

# The character attribute failed over to the OutfitMember class and this is now a
# SequenceProxy of Character, with the URL dynamically updated in the background.
characters = outfit.members().character()

Supporting this in parallel to the existing syntax (which I would like to keep) either requires a revamp of how proxy objects work, or some decorator-infused Descriptor object that allows accessing the URL used to link these related object types.

@leonhard-s leonhard-s added enhancement New feature or request discussion Additional opinions wanted labels Sep 13, 2020
@leonhard-s
Copy link
Owner Author

Related to proxies:

It would be handy to have an asynchronous lazy-loader for time-insensitive data (such as resolving player names from the ESS stream). It would group requests to the same data type together and eventually send them as a larger query, either triggered by batch size or time passed:

async def get_soon(type_: Type[T], query: Query, max_entries: int = 20, max_delay: float = 30.0) -> T:
    ...

They would remain separate, create a common asyncio event/future, which is then split back up into individual objects to be returned to the respective get_soon callers' futures.

@leonhard-s leonhard-s added the prio:low A nice-to-have label Sep 19, 2020
@leonhard-s leonhard-s added this to the Version 0.1 Beta milestone Sep 23, 2020
@leonhard-s leonhard-s removed this from the Version x.x milestone May 7, 2021
@leonhard-s leonhard-s added prio:normal No immediate action required and removed prio:low A nice-to-have labels Mar 5, 2023
@leonhard-s
Copy link
Owner Author

Bumping priority as I am unhappy with the proxy system both for maintainability, performance, and flexibility. Considering deprecation for 0.3.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
discussion Additional opinions wanted enhancement New feature or request prio:normal No immediate action required
Projects
None yet
Development

No branches or pull requests

1 participant