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

Callback queue #29

Merged
merged 4 commits into from
Jun 9, 2019
Merged

Callback queue #29

merged 4 commits into from
Jun 9, 2019

Conversation

trapajim
Copy link
Contributor

@trapajim trapajim commented May 9, 2019

i've added a simple fifo queue for the callbacks.
requested in #19

@@ -4,7 +4,7 @@ import (
"fmt"
"time"

"github.com/muesli/cache2go"
"github.com/trapajim/cache2go"
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Careful, I assume you accidentally committed that change. Please revert it.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sorry for that. I've changed it.

@muesli
Copy link
Owner

muesli commented May 15, 2019

Nice contribution, thank you!

@@ -35,6 +38,8 @@ func main() {
// Deleting the item will execute the AboutToDeleteItem callback.
cache.Delete("someKey")

//remove AddedItemCallbacks
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That comment feels a bit redundant 😄

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not sure what i've thought there, I removed the comment.

@coveralls
Copy link

Coverage Status

Coverage remained the same at 100.0% when pulling 32afdb1 on trapajim:callback_queue into 46a3a44 on muesli:master.

@coveralls
Copy link

coveralls commented May 16, 2019

Coverage Status

Coverage remained the same at 100.0% when pulling 4003e6e on trapajim:callback_queue into 46a3a44 on muesli:master.

@muesli
Copy link
Owner

muesli commented May 17, 2019

Awesome, thanks for updating. One more thing occurred to me in the meantime though:

this could lead to breaking existing clients, if they relied on the behavior of the old callbacks being overwritten.

Here's an idea: how about we keep the set*Callback methods overwriting the entire list of callbacks, and add new add*Callback methods for the new functionality?

@trapajim
Copy link
Contributor Author

Awesome, thanks for updating. One more thing occurred to me in the meantime though:

this could lead to breaking existing clients, if they relied on the behavior of the old callbacks being overwritten.

Here's an idea: how about we keep the set*Callback methods overwriting the entire list of callbacks, and add new add*Callback methods for the new functionality?

That makes sense, I didn't think about that. I'll implement that soon.

@trapajim
Copy link
Contributor Author

trapajim commented Jun 7, 2019

@muesli just checking in if you saw the changes

@muesli muesli merged commit e6b6209 into muesli:master Jun 9, 2019
@muesli
Copy link
Owner

muesli commented Jun 9, 2019

@trapajim I'm terribly sorry, it seems I have indeed missed that notification! Thanks for your contributions, really appreciated!

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.

3 participants