Table of Contents

Class BlobCache

Namespace
Akavache
Assembly
Akavache.Core.dll

A class which represents a blobbed cache.

public static class BlobCache
Inheritance
BlobCache

Properties

ApplicationName

Gets or sets your application's name. Set this at startup, this defines where your data will be stored (usually at %AppData%[ApplicationName]).

public static string ApplicationName { get; set; }

Property Value

string

ForcedDateTimeKind

Gets or sets the DateTimeKind handling for BSON readers to be forced.

public static DateTimeKind? ForcedDateTimeKind { get; set; }

Property Value

DateTimeKind?

Remarks

By default, Newtonsoft.Json.Bson.BsonReader uses a DateTimeKind of Local and Newtonsoft.Json.Bson.BsonWriter uses Utc. Thus, DateTimes are serialized as UTC but deserialized as local time. To force BSON readers to use some other DateTimeKind, you can set this value.

InMemory

Gets or sets an IBlobCache that simply stores data in memory. Data stored in this cache will be lost when the application restarts.

public static ISecureBlobCache InMemory { get; set; }

Property Value

ISecureBlobCache

LocalMachine

Gets or sets the local machine cache. Store data here that is unrelated to the user account or shouldn't be uploaded to other machines (i.e. image cache data).

public static IBlobCache LocalMachine { get; set; }

Property Value

IBlobCache

Secure

Gets or sets an IBlobCache that is encrypted - store sensitive data in this cache such as login information.

public static ISecureBlobCache Secure { get; set; }

Property Value

ISecureBlobCache

TaskpoolScheduler

Gets or sets the Scheduler used for task pools.

public static IScheduler TaskpoolScheduler { get; set; }

Property Value

IScheduler

UserAccount

Gets or sets the user account cache. Store data here that is associated with the user; in large organizations, this data will be synced to all machines via NT Roaming Profiles.

public static IBlobCache UserAccount { get; set; }

Property Value

IBlobCache

Methods

EnsureInitialized()

Makes sure that the system has been initialized.

public static void EnsureInitialized()

Shutdown()

This method shuts down all of the blob caches. Make sure call it on app exit and await / Wait() on it.

public static Task Shutdown()

Returns

Task

A Task representing when all caches have finished shutting down.