Commit graph

106 commits

Author SHA1 Message Date
Karl Seguin
1189f7f993 make Clear thread-safe 2020-08-16 21:12:47 +08:00
Karl Seguin
839a17bedb Remove impossible race conditions from test
This makes the output of go test --race less noisy.
2020-08-16 19:07:52 +08:00
Karl Seguin
0dbf3f125f add TrackingSet to LayeredCache 2020-08-14 11:15:13 +08:00
Karl Seguin
f3b2b9fd88
Merge pull request #48 from sargun/master
Add TrackingSet method
2020-08-14 11:03:30 +08:00
Karl Seguin
aa0e37ad6f
Merge pull request #47 from bep/type-deletefunc
Use typed *Item in DeleteFunc
2020-08-14 10:56:02 +08:00
Sargun Dhillon
df91803297 Add TrackingSet method
This method reduces the likelihood of a race condition where
you can add a (tracked) item to the cache, and the item isn't
the item you thought it was.
2020-08-13 10:43:38 -07:00
Bjørn Erik Pedersen
a42bd4a9c8
Use typed *Item in DeleteFunc 2020-08-13 16:10:22 +02:00
Karl Seguin
e9b7be5016 remove race condition 2020-08-13 15:49:28 +08:00
Karl Seguin
fdd08e71c4
Merge pull request #46 from bep/document-deletefunc
Document DeleteFunc
2020-08-13 15:47:33 +08:00
Bjørn Erik Pedersen
992cd9564b
Document DeleteFunc 2020-08-13 09:05:27 +02:00
Karl Seguin
f63031fa40
Merge pull request #45 from bep/DeleteFunc
Add DeleteFunc
2020-08-13 10:37:20 +08:00
Bjørn Erik Pedersen
d56665a86e
Add DeleteFunc
This shares DeletePrefixs's implementation.
2020-08-12 17:47:11 +02:00
Karl Seguin
223703f7f0
Merge pull request #44 from bep/layered-delete-prefix
Add DeletePrefix to LayeredCache
2020-08-12 08:39:47 +08:00
Bjørn Erik Pedersen
a24d7f8c53
Add DeletePrefix to LayeredCache 2020-08-11 19:04:54 +02:00
Karl Seguin
3b58df727e
Merge pull request #43 from jonathonlacher/patch-1
fix spelling in readme
2020-07-17 14:07:50 +08:00
Jonathon Lacher
4c88bf60e6
fix spelling in readme 2020-07-16 15:15:43 -05:00
Karl Seguin
eab9dbaa7f update readme to /v2 2020-06-29 20:50:55 +08:00
Karl Seguin
937ca294e6 go mod version 2020-06-29 15:22:50 +08:00
Karl Seguin
40275a30c8 Ability to dynamically SetMaxSize
To support this, rather than adding another field/channel like
`getDroppedReq`, I added a `control` channel that can be used for these
miscellaneous interactions with the worker. The control can also be
used to take over for the `donec` channel
2020-06-26 20:22:30 +08:00
Karl Seguin
d9aec58960 add GetDropped documentation 2020-02-16 11:54:07 +08:00
Karl Seguin
1a257a89d6 add GetDropped function 2020-02-05 22:05:05 +08:00
Karl Seguin
78289f8f0b
Merge pull request #38 from karlseguin/DeletePrefix
Delete prefix
2020-01-23 13:03:42 +08:00
Karl Seguin
79f9dcde21 fewer defers, document DeletePrefix 2020-01-23 12:55:55 +08:00
Karl Seguin
04261a5282 Merge branch 'master' into DeletePrefix 2020-01-23 12:50:53 +08:00
Karl Seguin
569ae60338
Merge pull request #37 from aporeto-inc/pin-expect
fixed/module: expect needs to be on master
2020-01-23 11:44:58 +08:00
Antoine Mercadal
048ac0669f
fixed/module: expect needs to be on master 2020-01-22 19:35:19 -08:00
Karl Seguin
2ff4136636
Merge pull request #36 from aporeto-inc/go-modules
migrate to go modules
2020-01-23 11:19:07 +08:00
Antoine Mercadal
f79de0e254
migrate to go modules 2020-01-22 19:16:52 -08:00
Karl Seguin
356e164dd5 preliminary work on DeletePrefix 2020-01-23 10:27:12 +08:00
Karl Seguin
2ff889bcae document Clear 2020-01-23 10:04:47 +08:00
Karl Seguin
46ec5d2257 explicitly state the thread-safety nature of the library 2020-01-23 09:38:19 +08:00
Karl Seguin
ec06cd93a0
Merge pull request #28 from buglloc/bucket_tests
Fixed bucket tests
2019-02-23 22:26:40 +07:00
Andrew Krasichkov
8d8b062716 fixed bucket tests 2019-02-14 15:54:01 +03:00
Karl Seguin
3385784411 Add cache.ItemCount() intt64 API 2019-01-26 12:33:50 +07:00
Karl Seguin
692cd618b2 guard access to item.promotions in LayeredCache, which was applied to Cache in 557d56ec6f 2018-12-27 22:54:50 +07:00
Karl Seguin
142396791e
Merge pull request #22 from alexejk/gcOnDelete
Calling OnDelete from gc()
2018-11-26 20:29:43 +07:00
Alexej Kubarev
243f5c8219
Fixes #21. Callong OnDelete during gc() 2018-11-25 15:31:09 -08:00
Alexej Kubarev
7e55af0a9c
Small routine lock file upgrade 2018-11-25 15:29:47 -08:00
Karl Seguin
a317416755
Merge pull request #16 from alexejk/onremove
Support for OnDelete() callback
2018-07-22 11:17:02 +07:00
Alexej Kubarev
7421e2d7b4
Adding support for OnDelete callback function
OnDelete will receive an item that is being processed for deletion to support calling cleanup function specific to the item stored
2018-07-16 18:20:17 +02:00
Alexej Kubarev
72059a01e9
Adding missing ignore file to ensure vendor folder is not checked in 2018-07-16 18:18:51 +02:00
Alexej Kubarev
00324cb2d2
Adding dep dependency management files to utilize vendoring 2018-07-16 18:18:02 +02:00
Karl Seguin
b425c9ca00 Merge pull request #11 from EdwardBetts/spelling
correct spelling mistake
2017-09-04 13:47:32 +07:00
Edward Betts
0d05fa8278 correct spelling mistake 2017-09-01 11:40:44 +01:00
Karl Seguin
3ba9789cfd Merge pull request #10 from heyitsanthony/test-races
fix data races in tests
2017-02-17 13:08:20 +07:00
Anthony Romano
b3c864ded7 cache: make Stop() synchronous and races in tests
worker goroutine running concurrently with tests would cause data race errors
when running tests with -race enabled.
2017-02-13 15:39:24 -08:00
Anthony Romano
c69270ce08 layeredcache: add Stop() and fix races in tests
worker goroutine running concurrently with tests would cause data race errors
when running tests with -race enabled.
2017-02-13 15:39:24 -08:00
Karl Seguin
12c7ffdc19 Merge pull request #9 from spicydog/patch-1
Fix an error in example "itemsToPrune"
2016-12-22 18:15:50 +07:00
spicydog
77679ba342 Fix an error in example "itemsToPrune"
itemsToPrune -> ItemsToPrune
2016-12-21 20:07:16 +10:00
Karl Seguin
a2d6215577 Merge pull request #8 from jdeppe-pivotal/master
Add a SecondaryCache which exposes the secondary part of a LayeredCache
2016-11-03 22:19:53 +07:00