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 - sttc/java-sdk: Java Client SDK for Stateful.co

BranchesTags
Open more actions menu

Latest commit

 

History

343 Commits
343 Commits

Folders and files

NameName
Last commit message
Last commit date
.github
.github
 
 
LICENSES
LICENSES
 
 
src
src
 
 
.0pdd.yml
.0pdd.yml
 
 
.gitattributes
.gitattributes
 
 
.gitignore
.gitignore
 
 
.pdd
.pdd
 
 
.rultor.yml
.rultor.yml
 
 
LICENSE.txt
LICENSE.txt
 
 
README.md
README.md
 
 
REUSE.toml
REUSE.toml
 
 
pom.xml
pom.xml
 
 
renovate.json
renovate.json
 
 

Repository files navigation

Java SDK for Stateful.co

EO principles respected here DevOps By Rultor.com We recommend IntelliJ IDEA

mvn Maven Central Javadoc

This is Java SDK for Stateful.

See our JavaDoc.

First, register an account at Stateful. Then, you can create a counter and increment it:

import co.stateful.Counter;
import co.stateful.Counters;
import co.stateful.Sttc;
import co.stateful.RtSttc;
import com.jcabi.urn.URN;
public class Main {
  public static void main(String... args) {
    Sttc sttc = new RtSttc(
      new URN("urn:github:526301"),
      "9FF3-41E0-73FB-F900"
    );
    String name = "test-123";
    Counters counters = sttc.counters();
    Counter counter = counters.create(name);
    long value = counter.incrementAndGet(1L);
    System.out.println("new value: " + value);
    counters.delete(name);
  }
}

Here is how you can use a lock:

Locks locks = sttc.locks();
Lock lock = locks.get("test-lock");
Callable<Void> work = new Callable<Void>() {
  @Override
  public Void call() {
    // perfectly synchronized code
    return null;
  }
};
new Atomic<>(work, lock).call();

How to Contribute

Fork repository, make changes, send us a pull request. We will review your changes and apply them to the master branch shortly, provided they don't violate our quality standards. To avoid frustration, before sending us your pull request please run full Maven build:

mvn clean install -Pqulice

You will need Maven 3.3+ and Java 11+.

About

Java Client SDK for Stateful.co

java-sdk.stateful.co

Topics

javajava-sdklocksmulti-nodesynchronization

Resources

Readme
License
Activity
Custom properties

Stars

10 stars

Watchers

3 watching

Forks

3 forks
Report repository

Releases

Used by

Contributors

Languages

You are visitor 01402503 — 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.