Skip to content
This repository was archived by the owner on May 21, 2022. It is now read-only.

add pooledObject validate#4

Merged
pomma89 merged 1 commit intopomma89:masterfrom
uliian:master
Jun 24, 2017
Merged

add pooledObject validate#4
pomma89 merged 1 commit intopomma89:masterfrom
uliian:master

Conversation

@uliian
Copy link
Copy Markdown

@uliian uliian commented Jun 20, 2017

In my scenario, I need to do some usability validation on the Pooledobject. Eg: (TCP connectivity) I want to join the object validation feature. If we are free in the future, we can also join the background thread verification feature.

@pomma89
Copy link
Copy Markdown
Owner

pomma89 commented Jun 20, 2017

Hi @uliian,

Thanks for your PR. I must take some time to evaluate your changes, in order to see how well they fit with existing specialized and timed pools; in fact, the addition of validation might make it easier to implement those pools.

Moreover, I think it might be useful to provide some sort of "validation context" to your method, which now might be an empty/dummy class, but it will let us give more information to the validation function without breaking the API.

Hoping that this change is not really urgent, I will merge and publish this as soon as possible, no later than this weekend.

@uliian
Copy link
Copy Markdown
Author

uliian commented Jun 22, 2017

😃 this change is not urgent。My PR is relatively hasty, we really should carefully consider its API design to ensure scalability

@pomma89 pomma89 merged commit f51f472 into pomma89:master Jun 24, 2017
@pomma89
Copy link
Copy Markdown
Owner

pomma89 commented Jun 24, 2017

Hi @uliian,

Could you have a look at these commits:

6e2bf8a
9980cc9

And let me know if my changes are OK for you?

I added a validation context, through which additional information might be given to the validation step, and I changed the way a subclass can provide its own validation step so that it was similar to existing extension points. Moreover, your validation is also used when an object returns to the pool.

Currently, the validation context only exposes the "direction" of an object (in or out of the pool). I already adapted existing specialized pools so that they use the new validation step, you can check the code in the second commit.

As soon as we agree on the changes, I can release the updated package.

@uliian
Copy link
Copy Markdown
Author

uliian commented Jun 26, 2017

No Problem!:bowtie:

@pomma89
Copy link
Copy Markdown
Owner

pomma89 commented Jun 26, 2017

Hi @uliian,

The updated package has been published to NuGet.

@pomma89 pomma89 mentioned this pull request Jul 1, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants