GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - erlang-one/kvs_feeds: Generic KVS feed-server

BranchesTags
Open more actions menu

Latest commit

 

History

2 Commits
2 Commits

Folders and files

NameName
Last commit message
Last commit date
include
include
 
 
src
src
 
 
.gitignore
.gitignore
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 
rebar.config
rebar.config
 
 

Repository files navigation

KVS Feeds

Generic KVS feed-server

Overview

Feed server for KVS abstract database middleware.

Implements database queries in the form of atomic operations or in other words, provides transaction for KVS-feeds logic.

Dependency

  • kvs – Database middleware.
  • n2o – n2o_async needed.

Configuration

sys.config

  • log :: {Mod,Fun} – Custom logging function/3, default: {wf,info}
  • feed_timeout :: non_neg_integer() – Pool worker timeout, in ms, default: 600000 (10 min)
  • feed_timeout_action :: hibernate | stop – Action for inactive pool workers, default: hibernate

Api

  • append(Record) – Add Record to database.
  • delete(Record) – Remove Record from database.
  • update(Record,Fun) – Update Record with Fun/1 which takes Record2 (at the time of execution) and should return {ok,Record3} (modified) if surgery is to be performed, or anything else to cancel.
  • relink(Record) – Bring Record to top in Record feed.
  • purge(Record,Fun) – Remove Record and related feeds with Fun/0 which should return a list of feeds, example: kvs_feeds:purge(E,fun() -> [{feed,attachments,fun kvs_feed:delete/1}] end), feed_id to be deleted will be generated as {attachment,element(2,E)} for feed container table.
  • eval(Record,Fun) – Eval custom Fun/1 which takes Record2 (at the time of execution), like as update/2.

Usage

R=#post{},
{ok,R2}=kvs_feeds:append(R),
Link = 1000,
FunUpdate=fun(#post{links=Links}=P) -> {ok,P#post{links=lists:usort([Link | Links])}} end,
{ok,R3}=kvs_feeds:update(R2,FunUpdate),
     ok=kvs_feeds:delete(R3),
        kvs_feeds:purge(R3,fun() -> [{feed,attachment,fun kvs_feeds:delete/1}] end),

Credits

  • @m-2k

About

Generic KVS feed-server

Topics

distributed-databasedistributed-hash-tabledistributed-storageerlangerlang-bindingserlang-librarieskvsmnesian2oriak

Resources

Readme
MIT license
Activity
Custom properties

Stars

3 stars

Watchers

0 watching

Forks

0 forks
Report repository

Releases

Packages

Contributors

Languages

You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.