Recollect.RetrievalCounter (recollect v0.5.1)

Copy Markdown View Source

GenServer that owns an ETS :counter table for retrieval bumps.

  • bump/1: O(1) :ets.update_counter call
  • Periodic flush: single bulk UPDATE to DB
  • terminate/2: final flush on shutdown

This replaces the previous pattern of one async UPDATE per search result.

Summary

Functions

Increment retrieval counter for an entry. O(1) operation.

Increment retrieval counters for multiple entries.

Returns a specification to start this module under a supervisor.

Functions

bump(entry_id)

Increment retrieval counter for an entry. O(1) operation.

bump_many(entry_ids)

Increment retrieval counters for multiple entries.

child_spec(init_arg)

Returns a specification to start this module under a supervisor.

See Supervisor.

start_link(opts \\ [])