GithubHelp home page GithubHelp logo

cookie-flipper's Introduction

Cookie flipper service

The cookie flipper is meant to be an example service for the metal-toolbox ecosystem of services in which a controller full-fills a cookieFlip Condition as they are queued up on the NATs Jetstream, the cookieFlip condition may be initiated(queued) by either the conditionorc API or by another service.

The cookie flipper service listens for events that are published with the cookieFlip subject suffix, it then unpacks the Condition within the event and proceeds to full-fill the condition based on the parameters included.

The cookieFlip condition is full-filled by the flipper by retrieving the cookie based on its identifier from the store, and then performing flips and delays based on the parameters specified.

As the cookie is being flipped, the flipper publishes its progress to the NATS k/v store.

Queuing a cookieFlip condition

An end user can request a cookieFlip condition by calling out to the conditionorc API service,

curl -Lv -X POST -d '{
            "exclusive": true,
            "parameters":
                {
                    "cookieID": "ede81024-f62a-4288-8730-3fab8cceab78",
                    "flips": 200,
                    "flip_delay": 20s
                }
            }' \

        localhost:9001/api/v1/servers/ede81024-f62a-4288-8730-3fab8cceab78/condition/cookieFlip

The status can then be checked using

    curl -Lv \
     localhost:9001/api/v1/servers/ed33d13d-bb56-42d8-aff4-594d4acbcbbf/condition/cookieFlip

cookie-flipper's People

Contributors

joelrebel avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.