Skip to content

Conversation

@gpauloski
Copy link
Collaborator

Description

Extends the Store to support associating newly created shared objects with a Lifetime, and adds two Lifetime implementations: the ContextLifetime and LeasedLifetime.

The original issue for this PR (#482) discussed supporting lifetimes in the context of proxy references (e.g., OwnedProxy, RefProxy, and RefMutProxy), but after working through the implementation, I decided it was better to take the approach of lifetimes being an alternate to proxy references because proxy references already encode a notion of lifetime.

It would be interesting to unify these in the future, so I've opened another issue to track that.

A new guide, "Object Lifetimes," has been created which discusses differences between and gives examples of the three mechanisms in ProxyStore for managing objects.

Fixes

Type of Change

  • Breaking Change (fix or enhancement which changes existing semantics of the public interface)
  • Enhancement (new features or improvements to existing functionality)
  • Bug (fixes for a bug or issue)
  • Internal (refactoring, style changes, testing, optimizations)
  • Documentation update (changes to documentation or examples)
  • Package (dependencies, versions, package metadata)
  • Development (CI workflows, pre-commit, linters, templates)
  • Security (security related changes)

Testing

Added new unit tests.

Pull Request Checklist

Please confirm the PR meets the following requirements.

  • Tags added to PR (e.g., breaking, bug, enhancement, internal, documentation, package, development, security).
  • Code changes pass pre-commit (e.g., mypy, ruff, etc.).
  • Tests have been added to show the fix is effective or that the new feature works.
  • New and existing unit tests pass locally with the changes.
  • Docs have been updated and reviewed if relevant.

@gpauloski gpauloski added the enhancement New features or improvements to existing functionality label Mar 20, 2024
@gpauloski gpauloski force-pushed the issue-482 branch 5 times, most recently from a70bfa5 to 8c68585 Compare March 20, 2024 18:44
@gpauloski gpauloski force-pushed the issue-482 branch 4 times, most recently from 0850c0b to a2ecc72 Compare March 20, 2024 19:08
The MacOS runners behave strangely with threading.Timer, often being
very slow so the callback is triggered. This adjusts the test to wait on
the Timer thread directly rather than having to guess right time to
sleep.
@gpauloski gpauloski merged commit 5b428e4 into main Mar 20, 2024
@gpauloski gpauloski deleted the issue-482 branch March 20, 2024 19:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New features or improvements to existing functionality

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Extend ownership model with custom lifetimes

2 participants