Socket
Book a DemoInstallSign in
Socket

actorjs-persist

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

actorjs-persist

ActorJs Core

1.0.5
latest
Source
npmnpm
Version published
Weekly downloads
1
Maintainers
1
Weekly downloads
 
Created
Source

ActorJs Persist

See ActorJs Core

Description

ActorJs Persist contains different strategies to persist events created by the actor. A persistence provider need to be registered at the actor system.

Installation

Install it

npm i actorjs-persist

Use it nodejs

var actorPersist = require('actor-persist');

Use it web

var actorPersist = actorjs.persist;

Register provider

actorSystem.setPersistenceProvider();

Usage

Persistent actors require on extra update function on the actor. This function is used to update the internal state of the actor. For persistent actors it is better to use functions instead of objects.

function actor(){
    
    this.receive = function(msg){
        // receive messages 
    };
    
    this.update = function(msg){
        // handle messages to change internal state
    };
        
}

Local/Session Storage

This class can be used in the browser to persist events in the local or session storage. It has one construct parameter which can be 'local' or 'session'.

var provider = new actorPersist.PersistStorage("local");
actorSystem.setPersistenceProvider(provider);

FAQs

Package last updated on 15 Jan 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.