Skip to main content
Home
This release is a pre-release — the latest non-prerelease version of @fedify/botkit is 0.2.1. Jump to this version

@fedify/botkit@0.3.0-dev.119+a1068dd9
Built and signed on GitHub Actions

A framework for creating ActivityPub bots

This package works with Deno
This package works with Deno
JSR Score
88%
Published
a week ago (0.3.0-dev.119+a1068dd9)
class MemoryCachedRepository
implements Repository

A repository decorator that adds an in-memory cache layer on top of another repository. This is useful for improving performance by reducing the number of accesses to the underlying persistent storage, but it increases memory usage. The cache is not persistent and will be lost when the process exits.

Note: List operations like getMessages and getFollowers, and count operations like countMessages and countFollowers are not cached and always delegate to the underlying repository.

Constructors

new
MemoryCachedRepository(
underlying: Repository,
)

Creates a new memory-cached repository.

Properties

Methods

addFollowee(
followeeId: URL,
follow: Follow,
): Promise<void>
addFollower(
followId: URL,
follower: Actor,
): Promise<void>
addMessage(
id: Uuid,
activity: Create | Announce,
): Promise<void>
addSentFollow(
id: Uuid,
follow: Follow,
): Promise<void>
countVotes(messageId: Uuid): Promise<Readonly<Record<string, number>>>
getFollowee(followeeId: URL): Promise<Follow | undefined>
getMessage(id: Uuid): Promise<
Create
| Announce
| undefined
>
getSentFollow(id: Uuid): Promise<Follow | undefined>
removeFollowee(followeeId: URL): Promise<Follow | undefined>
removeFollower(
followId: URL,
followerId: URL,
): Promise<Actor | undefined>
setKeyPairs(keyPairs: CryptoKeyPair[]): Promise<void>
updateMessage(
id: Uuid,
updater: (existing: Create | Announce) =>
Create
| Announce
| undefined
| Promise<
Create
| Announce
| undefined
>
,
): Promise<boolean>
vote(
messageId: Uuid,
voterId: URL,
option: string,
): Promise<void>

New Ticket: Report package

Please provide a reason for reporting this package. We will review your report and take appropriate action.

Please review the JSR usage policy before submitting a report.

Add Package

deno add jsr:@fedify/botkit

Import symbol

import { MemoryCachedRepository } from "@fedify/botkit/repository";
or

Import directly with a jsr specifier

import { MemoryCachedRepository } from "jsr:@fedify/botkit/repository";