Skip to content

A Nanome plugin used to send and receive messages with NTS via Redis PubSub

License

Notifications You must be signed in to change notification settings

nanome-ai/plugin-redis-pubsub

Repository files navigation

Redis Pubsub interface for Nanome Workspaces

Nanome is an immersive XR platform for collaborative computationally-driven molecular design. Learn more about Nanome at https://nanome.ai.

This plugin creates an interface for interacting with your workspace via Redis PubSub messages. This enables simpler programmatic communication between applications. For example, Nanome's Jupyter notebooks communicate with your workspace via this interface. (https://github.com/nanome-ai/plugin-cookbook)

Installation

Requirements:

Clone, Build, and deploy

  1. Use Git to clone this repository to your computer.
git clone https://github.com/nanome-ai/plugin-redis-pubsub.git
  1. Create .env file, containing NTS connection values, as well as credentials for a running Redis instance
cp .env.sample .env
  1. Build and deploy
python run.py

Redis RPC architecture

  • plugin container runs your standard plugin instance. When activated in Nanome, a room id is assigned, and the plugin subscribes to a unique Redis channel corresponding to the room id. The plugin starts polling, waiting to receive messages containing info on what function to run.
{
  "function": <function_name>
  "args": [...],
  "kwargs": {...},
  "response_channel": "uuid4()"
}

alt text

Contributors

@mjrosengrant @ajm13

About

A Nanome plugin used to send and receive messages with NTS via Redis PubSub

Resources

License

Stars

Watchers

Forks

Packages

No packages published