store_avatar


Description:

public async string store_avatar (string id, LoadableIcon avatar) throws Error

Store an avatar in the cache, assigning the given globally unique ID to it, which can later be used to load and remove the avatar from the cache. For example, this ID could be the UID of a persona. The URI of the cached avatar file will be returned.

This method may be called multiple times concurrently for the same avatar ID (e.g. an asynchronous call may be made, and a subsequent asynchronous call may begin before the first has finished).

Concurrent file I/O may be rate limited within each AvatarCache instance to avoid file descriptor exhaustion.

Parameters:

id

the globally unique ID for the avatar

avatar

the avatar data to cache

Returns:

a URI for the file storing the cached avatar

Exceptions:

GLib.Error

if the avatar data couldn't be loaded, or if creating the avatar directory or cache file failed

Since:

0.6.0




2022 vala-language.org