Skip to content

What are the expectations for a recycle implementation? #371

Answered by bikeshedder
Electron100 asked this question in Q&A
Discussion options

You must be logged in to vote

I somehow assumed that it's pretty self explanatory what it is expected to do and didn't put too much thought into writing more documentation for it.

  • create is used to create new objects
  • recycle is used to recycle existing objects

The important bit missing here is...

recycle MUST ensure that the object is in working condition. If the object was modified (e.g. listeners registered, connection parameters changed, etc.) it SHOULD be reset or discarded by returning an error.

The reset step is not a hard requirement. It might actually be the case that you know for sure that your code doesn't modify the objects. Performing a full cleanup can hurt performance. e.g. that's the reason why dead…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by Electron100
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants