Giter Site home page Giter Site logo

msgfs's Introduction

Msgfs
=====

Jeff Read <[email protected]>

Msgfs is a little proof of concept of a multicast publish-subscribe
bus that uses inotify to alert listening processes. It is not a file
system in its own right, but rather a protocol which uses the file
system to achieve a form of inter-process communication.

The protocol is as follows: To send a message, write to a file in a
directory that has msgfs listeners watching it via inotify, and then
close the file.

To receive messages, add an inotify watch to the directory with event
mask IN_CLOSE_WRITE with inotify_add_watch(2). When you receive an
event on this watch, it means a message has been sent; the file's
contents are the body of the message; you can open(2) the file and
read(2) or mmap(2) it to get at its contents.

A new file should be created (with UUIDs, mkstemp, or similar) for
every message sent. Senders are responsible for cleaning up the
messages they create (perhaps after a timeout).

Advantages
----------

1. Multicast-capable, publish-subscribe messaging. Unix permissions
determine who may send and who may receive messages on a particular
"bus".

2. Serialization-agnostic. Ship XML, JSON, text, binary, whatever you
like.

3. Message size limited by file size. Want to alert a group of
processes about a cool new lolcat JPEG? Send it as-is in a message!

4. Send messages with 'echo' :)

Drawbacks
---------

1. It's probably insecure as all get-out. Anyone with read access to
the msgfs message can see it; anyone with write access can clobber
existing messages before their intended consumers can open them in a
race condition, etc. DO NOT transmit sensitive information with this
version of msgfs. :)

2. The API presented in msgfs.h does not support asynchronous polling
for msgfs events.

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.