npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

tart-checkpoint

v0.1.0

Published

Tart checkpoint

Downloads

7

Readme

tart-checkpoint

Checkpointing configuration implementation for Tiny Actor Run-Time in JavaScript.

Contributors

@dalnefre, @tristanls

Overview

Checkpointing configuration implementation for Tiny Actor Run-Time in JavaScript.

Usage

To run the below example run:

npm run readme
"use strict";

var tart = require('../index.js');

var checkpoint = tart.checkpoint();

var oneTimeBeh = (function oneTimeBeh(message) {
    console.log('oneTimeBeh:', message);
    var becomeBeh = (function becomeBeh(message) {}).toString();
    var actor = this.sponsor((function createdBeh(message) {
        console.log('createdBeh:', message);
    }).toString()); // create
    actor(this.state.label); // send
    this.behavior = becomeBeh; // become
}).toString();

var actor = checkpoint.sponsor(oneTimeBeh, { label:'foo' });
actor('bar');

Tests

npm test

Documentation

Checkpoint objects are intended to be safely convertible to JSON and back again without loss of information.

Events

An event is an Object that represents a message sent to an actor.

An event has the following attributes:

  • domain: String URI identifying the domain that generated the event.
  • time: Number Date.now() timestamp when the event was generated.
  • seq: Number event sequence number, monotonically increasing within time.
  • message: String Transport-encoded message to be delivered.
  • token: String Transport token identifying the target actor.

Actors

An actor is an Object that represents a unique entity with state and behavior.

An actor has the following attributes:

  • state: String Transport-encoded object representing the actor's state.
  • behavior: String The actor's behavior function in source form.
  • token: String Transport token uniquely identifying this actor.

Effects

An effect is an Object that represents the result of processing an event.

An effect has the following attributes:

  • created: Object (Default: {}) A map from tokens to newly-created actors.
  • sent: Array (Default: []) An array of events representing newly-sent messages.
  • output: Array (Default: []) An array of transport-encoded messages to remote actors.
  • cause: Object (Default: undefined) The event that is the cause of this effect, if any.
  • update: Function (Default: undefined) The new state and behavior of the actor that caused this event.
  • exception: Object (Default: undefined) If dispatching the event caused an exception, that exception is stored here.

Public API

tart.checkpoint(options)

  • options: Object (Default: undefined) Optional overrides.
    • logEffect: Function function (effect, callback) {} Record effect, then call callback(error).
  • Return: Object The checkpoint control object.
    • domain: Object Marshal domain.
    • router: Object Router for marshal domain.
    • sponsor: Function function (behavior[, state[, token]]) {} A capability to create new actors with persistent state and optional identity.

Create a checkpoint control object.

Sources