Skip to content

greycat-incubator/Gala

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Greycat AdditionaL Actions

The Greycat AdditionaL Actions (gala) project is a plugin for Greycat providing additional actions to the one offered by Greycat.

version

Actions?

Actions are reusable elements hiding low-level, asynchronous task primitives behind an expressive API. Actions allows to traverse and manipulate the graph and can be chained to form a task.

Why additional Actions?

A great number of action are already implemented and available in Greycat, please refer to the greycat.internal.task package of Greycat.

However, thinking and implementing every possible actions would:

  1. be impossible
  2. drastically increase the size of the project.

That's why only basic, i.e., atomic, actions are implemented.

Yet, users might need more composed actions like Injecting an object as a variable or Putting the result of a get action in a variable instead of in the result.

Thus this project has the following objectives:

  • offer more complex general purpose actions
  • provide an example of Actions development to developers eager to develop some for their own need :)

What is currently offered:

Currently offered actions are:

How to use it?

This plugin can be used the same way as other Greycat plugins.

1 . Declare the plugin in your Graph Build

Graph g = new GraphBuilder()
	.withPlugin(new ActionsPlugin())
	.build();

2 . Then call action(MyAction.Name) in your task chain or use then(Actions.myaction()) to launch it.

newTask()
.action(ActionIncrement.NAME,"myvar","1")
.then(Actions.count())

Please Note that the first option is usable for almost all of the actions and works seamlessly in java or javascript. On the other hand, a function like injectAsVar that require a native object can only be called using then and can not be used from javascript.

3 . That's all =)

About

Greycat AdditionaL Actions

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages