Giter Site home page Giter Site logo

any.js's Introduction

Any.JS

Any.JS (Anywhere JSONs) is a distributed general purpose computing middleware that supports maps, global variables and tasks concepts. It is designed for JavaScript code, but it will also support Python and Java in near future. There is an interoperable REST API sending and receiving JSON objects to the cloud.

Any.JS is a containerized and resilient scalable solution. Programmers can use its API directly or they can also create customized clients in different programming languages. There is a Python client to represent this issue.

The middleware solution is asynchronous, thus object instantiation or storage, maps manipulations and tasks executions are performed asynchronously. There are ways to observe and wait for a service conclusion. The wait is useful for tasks and it has a time to wait a period of time for a task result. The observe, on the other hand, waits until a global variable or a map or a map entry (key-value pair) changes their states (delete, insert, update, for instance).

Services

  • Register: Responsible for upload all JavaScript or Java or Python code to the cluster. This process must be done at least once because many other service types, like execute and instantiate, use these codes to perform their jobs. The user just inform the location via URL of the code and Any.JS performs the download.

  • Execute: It will execute a method of a class in an asynchronous and decentralized way. For that, the programmer must, through a JSON, pass to the API the parameters to execute the method, the previous registered module and the name of the method. The method parameters can be simple ones or complex JSON objects.

  • Execute Batch: It will execute the same method of a class multiple times with different parameters. All executions are asynchronous and decentralized. Internally, Any.JS receives all runs and distribute them among all Any.JS containers available in the cluster. Each container can receive multiple method runs because there is a bag of tasks on each Any.JS running container to handle them. In the programmer perspective, it is necessary to mount a JSON and call the API just once with such JSON to perform multiple method calls. The method parameters can be simple ones or complex JSON objects. Since Execute Batch runs a method multiple times, there is a set of set of parameters in the JSON, one set per method run. The results of a batch can be obtained asynchronously via Observer, which means that each task result can be obtained individually, avoiding all batch method runs conclusion.

  • Store: Responsible for storing an object already instantiated by the user. The object must be serialized to Binary JSON (BSON) format.

  • Instantiate: Responsible for instantiating an object and storing it in the cluster, this way, the user must specify the constructor name, the previous registered module and the parameters (similar to Execute service).

  • Lock and Unlock: Performs secure access to a variable previous created via Instantiate or Store services, or to a map entry previous created and populated via M ap services. Both Lock and Unlock primitives require the name of the variable or the key of a map entry. They guarantee concurrent accesses of resources using a simple mutual exclusion solution. Any.JS uses a FIFO access order internally. Besides that, Lock and Observe are the unique synchronous services of the entire RESTful API.

  • Map: Represents a transparent JavaScript distributed map in the API, thus all methods available in many map data structures of many programming languages are made available for use in the API, including the iterator, putALL and so many others.

  • Observe: Represents a catalog of collections of Any.JS and a publish/subscribe mechanism. Applications can subscribe to these collections if the user wants to be notified of a service state change, being it a task execution completion or a variable storage or any other API option.

The REST API

The REST API can be called by any client developed with any programming language or by an API caller, like Insomnia or Postman.

Details about the REST API at open api documentation.

Docker image

If you want to use the middleware docker image, you can access it directly from docker hub at this link.

Research background

Any.JS final report link.

any.js's People

Contributors

lucasurzedo avatar joubertlima avatar riibeirogabriel avatar

Stargazers

Flávio Pangrácio avatar  avatar Alexandre Coelho avatar Matheus Almeida avatar  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.