Code Monkey home page Code Monkey logo

pervasive's Introduction

Pervasive

Pervasive is a simple prototype of a distributed and asynchronous resource dispatcher. The typical scenario is as follows. A user submits a resource to Pervasive indicating the topics that resource is related to as well as the name of the file, where the content of the resource is stored. Pervasive then identifies the devices, which might be interested in displaying the resource.

Pervasive is implemented in Node.js (using both javascript and coffeescript)

Node.js Installation

Go to http://nodejs.org/ for more information about Node.js and its installation.

Quick tip

If you are on Mac OS X and using homebrew as your package manager, the following command should do.

Cloning the repository

When cloning the repository, make sure to include the submodules (with the right versions).


	brew install --force -v node

If you do not own /usr/local, you should use sudo. You can own /usr/local using the chown command You should also install npm, the node.js package manager.

App Usage

To use our small app, first start the web server


	node pervasive_server_ws 
	or
	node pervasive_server_tcp

At this point, you have two choices:

  • Either use a TCP connection between the devices and Pervasive
  • Or use WebSockets

Pervasive with TCP connection

The TCP version of Pervasive requires to use the file local_manager_tcp instead of local_manager. In that case you need to start the devices as TCP connections. You could use Telnet or netcat. Below, is an example with netcat.


	nc localhost prt_number

Pervasive with WebSockets

Here, you don't have to do anything. The devices will be created for you automatically and the connections established as well.

Finally, open a Web connection as follows. Here again you can just do if from the terminal with curl.


curl -d "topic=val&topic=energy&file_name=ad1.txt" localhost:8080 (the web server is running on port 8080)

The resource will be assigned depending on the topics and the content of the file ads/myres will be sent to the devices too.

Coffee Script

Who can really resist coffeescript these days? There is a coffee-script port of Pervasive coming out soon. The new coffeescript port is available in pervasive_coffee

Author

José G. Quenum

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.