Skip to content

Add the ability for manual invalidation of requests, preventi…#28

Open
arb000r wants to merge 2 commits into
HaveFunTrading:mainfrom
arb000r:feat/user-initiated-invalidation
Open

Add the ability for manual invalidation of requests, preventi…#28
arb000r wants to merge 2 commits into
HaveFunTrading:mainfrom
arb000r:feat/user-initiated-invalidation

Conversation

@arb000r
Copy link
Copy Markdown
Contributor

@arb000r arb000r commented Apr 20, 2026

Hello,

I would like to propose a feature to allow manual invalidation of requests.
Currently the pool (and any custom implementations) can only rely on disconnected as the primary flag for overseeing that a Connection is not pushed back into the pool. Updating it so that the disconnected flag could be updated did not seem to be the correct path, as it the flag would be responsible for two meanings.

I introduced a new flag called invalidated which can be marked by the request, which results in the underlying Connection not making it back to the pool.

arb000r added 2 commits April 20, 2026 15:05
…ng underlying connection from being reused in custom pool implementations.
@HaveFunTrading
Copy link
Copy Markdown
Owner

hi @arb000r - could you provide some use cases for the above? if we want more control over when a connection is dropped when returned to the pool I would try to make the contract stronger/better defined rather than relying on certain field(s).

@arb000r
Copy link
Copy Markdown
Contributor Author

arb000r commented May 5, 2026

Heya,

The example I was trying to make it fit was for expiring requests.

  1. Create request with a defined deadline
  2. Request is polled through a wrapper fn which checks above deadline. If deadline has passed. Return Err.
  3. Even though from a client implementation the deadline is passed, that connection may eventually have the response arrive. If the connection is returned to the pool and used for another request, the previous response will still be there.

The ability to invalidate a certain connection arbitrarily would be useful for custom pool implementations.

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.

2 participants