In association with heise online

01 May 2012, 14:06

Akavache cache open sourced by GitHub

  • Twitter
  • Facebook
  • submit to slashdot
  • StumbleUpon
  • submit to reddit

GitHub logo The developers at GitHub have announced the open sourcing of Akavache, an asynchronous, persistent key/value cache written in C# for desktop and mobile applications. The library is one they use inhouse; caching is an everyday task for application developers. Akavache, at its core is a byte array key-value store. The difference with Akavache is that it unifies the process of populating that cache through extensions allowing, for example, arbitrary JSON objects, responses to HTTP requests, images or account credentials, to be requested and cached using one library. In an example given by the developers, this code


var image = await BlobCache.LocalMachine.\
GetAndFetchLatest(tweet.AvatarUrl,
DownloadUrl(tweet.AvatarUrl),
createdAt =>DateTimeOffset.Now - createdAt
> TimeSpan.FromHours(6));

asks for an image to be downloaded if it is not in the cache or if the cached version is over six hours old. The library is asynchronous, so any operation that would block processing returns an Observable which represents a future result. This helps, say the developers, to solve a number of difficult concurrency problems in UI programming.

Akavache is available from the project's repository where potential users will find documentation on how to get started with the MIT licensed library.

(djwm)

Print Version | Send by email | Permalink: http://h-online.com/-1564393
 


  • July's Community Calendar





The H Open

The H Security

The H Developer

The H Internet Toolkit