Skip to content
Multi-sensory processing architecture
Python Makefile
Branch: v3
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
bin
examples
farmi
test
.gitignore
Makefile
README.md
setup.py

README.md

There are three main components to the multi sensory processing framework named farmi.

There are publishers, which publish data; there are subscribers which subscribe to data and there is a directory service where publishers register themselves so that subscribers can find them.

Below a minimal example is shown:

directory_service.py (or just run farmi-server)

from farmi import DirectoryService
ds = DirectoryService()
ds.listen()

receiver.py

from farmi import Subscriber

def fn(topic, time_, msg):
    print(topic, time_, msg)

s = Subscriber('some_topic', fn)
s.listen()

sender.py

import time
from farmi import Publisher
pub = Publisher('some_topic')
time.sleep(1)

for i in range(10):
    pub.send((i, "hello!"))

pub.close()
You can’t perform that action at this time.