Skip to content

Powerful nodejs library for building seamless distributed applications.

Notifications You must be signed in to change notification settings

feats/radiaction

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation


Powerful nodejs library for building seamless distributed applications.
Radiaction makes it painless for Developers to write distributed apps and for DevOps to keep everything running.

[ Check examples 👌 | Read the API 🤓 ]


  • Agnosticism: With Radiaction, developers don't need to know how/where/when their distributed functions will be running.

  • Modularity: Encapsulated modules containing actions and reactions next to each other allow developers to keep coding with the mindset of a non distributed application.

  • Separation of concerns: DevOps don't need to interfere on how developers are writting their functions. Scaling and even changing the infrasctructure can be done independently by DevOps with no change in the application code.

WARNING ⚠️ This is an experimental project. It's use is not yet recommended for production.

Please, consider helping us on the path to stability by contributing to this project 🍻💪

divider

API

Application side

Higher-order functions

emitter
import { emitter } from 'radiaction'

emitter(actionsMap: Object): Object

For each action, wraps it with a function that:

  • when called, dispatches a message to the broker, ultimately triggering the subscribed reaction.
  • returns the location of the dispatched message in the broker (async/promise).
topicfy
import { topicfy } from 'radiaction'

topicfy(moduleName: String)(actionsMap: Object): Object

Sanitizes the functions names while combining them with the provided key (moduleName). The resulting function names can be used as topic names.

waiter
import { waiter } from 'radiaction'

waiter(actionsMap: Object): Object

For each action, wraps it with a function that:

  • when called, notifies the broker that the given action is waiting for the output of its respective reaction.
  • returns the output of its respective reaction once its available (async/promise).

Utilities

compose
import { compose } from 'radiaction'

compose(...functions: Array<Function>)

Composes functions from right to left. You might want to use it to compose multiple higher-order functions into a single higher-order function.

This is a functional programming utility, and is included here as a convenience. It works exactly like the function of the same name in Recompose and Redux, or lodash's flowRight().

Distributed side

createTopics
import { createTopics } from 'radiaction'

createTopics(actionsMap: Object): Promise

Initializes the topics for every action. It only needs to be executed once.

runner
import { runner } from 'radiaction'

runner(reactionsMap: Object): Promise

Start runners that will subscribe to the topics associated with each action. It will:

  • execute the associated reaction
  • notify the broker that the output of the reaction is available.

divider

Examples

Take a look at the examples folder in order to see our available demos.