Carlos
is a small set of classes, functions and convenience operators to realize custom, flexible and powerful cache layers in your application.
By default,
Carlos
ships with an in-memory cache, a disk cache and a simple network fetcher(disk cache and network fetcher are inspired by HanekeSwift).
With
Carlos
you can:- create levels and fetchers depending on your needs, either through classes or with simple closures
- combine levels
- transform the key each level will get, or the values each level will output (this means you're free to implement every level independing on how it will be used later on). Some common value transformers are already provided with
Carlos
- Apply post-processing steps to a cache level, for example sanitizing the output or resizing images
- react to memory pressure events in your app
- automatically populate upper levels when one of the lower levels fetches a value for a key, so the next time the first level will already have it cached
- enable or disable specific levels of your composed cache depending on boolean conditions
- easily pool requests so you don't have to care whether 5 requests with the same key have to be executed by an expensive cache level before even only 1 of them is done.
Carlos
can take care of that for you - setup multiple lanes for complex scenarios where, depending on certain keys or conditions, different caches should be used
- Cap the number of concurrent requests a cache should handle
- have a type-safe complex cache that won't even compile if the code doesn't satisfy the type requirements
WeltN24
By the way, there is Brandon Case talking about Carlos at the Commercial Users of Functional Programming (CUFP) September 2016 in Nara, Japan!
Composable Caching in Swift
Slides
iOSCon 2017
There are even new Carlos-inspired project coming up:
Shallows
Shallows is a generic abstraction layer over lightweight data storage and persistence. It provides a Storage type, instances of which can be easily transformed and composed with each other. It gives you an ability to create highly sophisticated, effective and reliable caching/persistence solutions.
Shallows is deeply inspired by Carlos and this amazing talk by Brandon Kase.
Shallows is a really small, component-based project, so if you need even more controllable solution – build one yourself! Our source code is there to help.
GitHub
By the way, there is Brandon Case talking about Carlos at the Commercial Users of Functional Programming (CUFP) September 2016 in Nara, Japan!
Composable Caching in Swift
Slides
iOSCon 2017
There are even new Carlos-inspired project coming up:
Shallows
Shallows is a generic abstraction layer over lightweight data storage and persistence. It provides a Storage
Shallows is deeply inspired by Carlos and this amazing talk by Brandon Kase.
Shallows is a really small, component-based project, so if you need even more controllable solution – build one yourself! Our source code is there to help.
GitHub
Comments
Post a Comment