Skip to content

Rate-limit Event Ledger #2- Cache Read/Write Logic #2149

Description

@adi0106

Description

Implements the two cache paths: on a miss, the event is added to the cache and marked clean; on a hit, the incoming event's timestamp is compared to the stored one and the newer value is kept, with the entry marked pending. No writes to Cassandra occur in this task- the connection to Cassandra is included in a later task.

Definition of Done

  • Cache miss adds the event to the local cache and marks the entry clean (pending = false)
  • Cache hit with a newer timestamp replaces the stored value and marks entry pending (pending = true)
  • Cache hit with an older or equal timestamp discards the incoming event; stored value is unchanged
  • Concurrent updates to the same key do not produce data races

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions