Git Product home page Git Product logo

deno-date-iso's Introduction

deno-date-iso

main

The main script is equivalent to:

deno eval 'console.log(new Date().toISOString())'

Intended to be used to test a process runner e.g.:

deno run https://raw.githubusercontent.com/evanx/deno-date-iso/v0.0.1/main.ts

worker

The worker script is an experimental Redis-driven microservice approach:

  • the microservice requires a Redis "worker key" as a CLI parameter
  • the worker hashes provide configuration e.g. the requestStream key
  • an AES key is provided by stdin to decrypt any sensitive config e.g. account credentials
  • the worker sets and monitors the pid field to control its lifecycle
  • the worker will xreadgroup using the worker consumer group to processes requests
  • the worker will push the response to a single-entry "list" which will expire after a few seconds

The intention is that other workers can xadd requests, and brpop responses with a timeout.

Latest: https://raw.githubusercontent.com/evanx/deno-date-iso/v0.0.3/worker.ts

cli

image

The cli script can be used to setup and dev/test a worker e.g.:

  • create-request-stream - create the stream with worker consumer group
  • setup-worker - setup a worker hashes key
  • xadd-req - add a request to the stream

demo

The demo.sh shell script can be used to demonstrate the worker script e.g. if you wish to delete the request stream if it already exists:

./demo.sh clean

image

This script will:

  • create the request stream with a consumer group worker for collaborating workers to consume via xreadgroup
  • xadd a request to the stream
  • setup a worker key deno-date-iso:1:h
  • run the worker to process the added request
  • pop the response by request ID

For the demo, we set requestLimit to 1 and xadd a single request, so that the service will process that single request only and then exit.

deno-date-iso's People

Contributors

evanx avatar

Watchers

 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.