Slang Documentation

Index

There are currently 125 Slang operators with 37 tags

Aggregate operators

There are 11 operators tagged with aggregate

Sum
Emits the sum of a stream of numbers.
Emits first item of a stream of generic items.
Finds smallest number in a stream of numbers.
Finds the best item using a chooser delegate to decide which item is better.
Emits variance of a stream of numbers.
Finds greatest number in a stream of numbers.
Emits the median number of a stream of numbers.
Emits last item of a stream of generic items.
Counts number of items in a stream of generic items.
Emits the average of a stream of numbers.
Emits the product of a stream of numbers.

Arithmetic operators

There are 5 operators tagged with arithmetic

Emits the modulo, the remainer of a division of two numbers A and B.
Divides number A by number B.
Add
Adds two numbers A and B and emits their sum.
Multiplies two numbers A and B and emits their product.
Subtracts number B from number A and emits the resulting difference.

Boolean operators

There are 6 operators tagged with boolean

Evaluates an expression.
Xor
Emits true only if the given boolean values A and B are not equal.
Or
Emits true only if at least one of the given booleans A and B is true.
Emits true only if both booleans A and B are equal.
And
Emits true only if both given booleans A and B are true.
Emits the inverse of a given boolean.

Color operators

There are 1 operators tagged with color

Transforms an RGB pixel into a gray pixel.

Compare operators

There are 7 operators tagged with compare

Emits true if number A equals number B.
Emits true only if number A is less than or equal to number B.
Emits true only if number A does not equal number B.
Emits true only if number A is greater than number B.
Emits true only if number A is less than number B.
Emits true only if number A is greater than or equal to number B.
Emits true only if both booleans A and B are equal.

Compression operators

There are 2 operators tagged with compression

Packs a stream of binary content into a zip archive.
Unpacks a zip archive and emits a stream of files and their binary content.

Control operators

There are 8 operators tagged with control

Tries to acquire semaphore token.
Emits a constant value for each item.
Performs a task repetetively, at least once..
Emits items of a stream to either outgoing stream depending on the control value.
Merges two streams using a compare delegate deciding which item has precedence.
Takes two items and emits one of them, using a chooser delegate as decider.
Frees a semaphore token.
Emits either the first or the second item depending on the given boolean.

Convert operators

There are 4 operators tagged with convert

Takes a map of items and serializes them into a stream.
Takes a stream and emits a map of items, selected by given indices.
Takes a map and emits a stream of key-value pairs.
Takes a map and emits a stream of key-value pairs.

Csv operators

There are 2 operators tagged with csv

Reads a CSV file and emits a stream of lines, separated into columns.
Encodes streams into a single string.

Data operators

There are 8 operators tagged with data

Stores a value for later use.
Uses an iterator delegate to aggregate items of a stream.
Converts the type of a value.
Generates a random UUID.
Emits a value previously saved for each item.
Reduces the items of a stream pairwise using a reducer delegate.
Emits a constant value for each item.
Lets an iterator delegate process a state until the controller tells it to stop.

Database operators

There are 12 operators tagged with database

Executes a Set command at the specified Redis server.
Queries an SQL query on a relational database and emits the result set.
Reads an item from memory by key string.
Executes an subscribe command at the specified Redis server.
Executes an SQL query on a relational database.
Executes an HGet command at the specified Redis server.
Subscribes at a Kafka topic.
Executes an HIncr command at the specified Redis server.
Executes a Get command at the specified Redis server.
Executes an LPush command at the specified Redis server.
Executes an HSet command at the specified Redis server.
Writes an item to memory and associates it with a key string.

Email operators

There are 1 operators tagged with email

Sends an email.

Encoding operators

There are 6 operators tagged with encoding

Reads a CSV file and emits a stream of lines, separated into columns.
Decodes Excel data into a stream of sheets, each being a 2d-stream of cells.
Decodes a JSON string and emits the corresponding Slang data.
Encodes Slang data into a JSON string.
Encodes streams into a single string.
Encodes a Slang map into the corresponding URL-encoded string.

Exception operators

There are 2 operators tagged with exception

Replaces null items with specified value in a stream of primitive items.
Emits true only if a given primitive is null.

File operators

There are 6 operators tagged with file

Creates or replaces a file and writes binary data to it.
Appends binary data to a file or creates it if non existent.
Reads the contents of a file line by line and emits them as stream.
Appends serialization of generic item to file.
Reads the contents of a file and emits them.
Reads a file, deserializes each line and emits one item per line.

Function operators

There are 3 operators tagged with function

Evaluates an expression.
Emits the greatest integer less than or equal to a given number.
Calculates square root of a number.

Http operators

There are 7 operators tagged with http

Starts an HTTP server, uses a handler delegate to process requests.
Encodes a Slang map into the corresponding URL-encoded string.
Queries a given URL via GET using given parameters and emits the parsed response.
Sends an HTTP request.
Queries a given URL via GET request and emits its parsed response.
Decodes Excel data into a stream of sheets, each being a 2d-stream of cells.
Performs an HTTP get request at a given URL and emits body and status code.

Image operators

There are 3 operators tagged with image

Reads an encoded image binary and emits its pixels as stream of rgb values.
Takes pixels as stream of rgb values and encodes it into an image binary.
Transforms an RGB pixel into a gray pixel.

Json operators

There are 2 operators tagged with json

Decodes a JSON string and emits the corresponding Slang data.
Encodes Slang data into a JSON string.

Kafka operators

There are 1 operators tagged with kafka

Subscribes at a Kafka topic.

Math operators

There are 24 operators tagged with math

Evaluates an expression.
Emits true only if number A is greater than number B.
Emits the modulo, the remainer of a division of two numbers A and B.
Calculates square root of a number.
Finds greatest number in a stream of numbers.
Emits the z-score for each number of a stream of numbers.
Finds smallest number in a stream of numbers.
Calculates and emits moving average for each number of a stream of numbers.
Emits true if number A equals number B.
Flips the sign of a given number and emit the resulting number.
Emits the greatest integer less than or equal to a given number.
Emits variance of a stream of numbers.
Emits true only if number A is less than number B.
Divides number A by number B.
Emits the median number of a stream of numbers.
Emits true only if number A does not equal number B.
Sum
Emits the sum of a stream of numbers.
Emits true only if number A is greater than or equal to number B.
Emits true only if number A is less than or equal to number B.
Add
Adds two numbers A and B and emits their sum.
Subtracts number B from number A and emits the resulting difference.
Emits the average of a stream of numbers.
Emits the product of a stream of numbers.
Multiplies two numbers A and B and emits their product.

Memory operators

There are 2 operators tagged with memory

Reads an item from memory by key string.
Writes an item to memory and associates it with a key string.

Mqtt operators

There are 2 operators tagged with mqtt

Subscribes at a given topic, behaves like an MQTT client.
Publishes an MQTT message at a given topic.

Network operators

There are 9 operators tagged with network

Subscribes at a given topic, behaves like an MQTT client.
Sends an HTTP request.
Performs an HTTP get request at a given URL and emits body and status code.
Starts an HTTP server, uses a handler delegate to process requests.
Publishes an MQTT message at a given topic.
Queries a given URL via GET using given parameters and emits the parsed response.
Sends an email.
Queries a given URL via GET request and emits its parsed response.
Builds a URL value from given protocol, host, port, path and query string.

Random operators

There are 1 operators tagged with random

Generates a random UUID.

Redis operators

There are 7 operators tagged with redis

Executes a Set command at the specified Redis server.
Executes an LPush command at the specified Redis server.
Executes an HIncr command at the specified Redis server.
Executes a Get command at the specified Redis server.
Executes an HSet command at the specified Redis server.
Executes an HGet command at the specified Redis server.
Executes an subscribe command at the specified Redis server.

Smtp operators

There are 1 operators tagged with smtp

Sends an email.

Sort operators

There are 2 operators tagged with sort

Sorts a stream, using a comparator delegate specifying the order.
Sorts a stream of primitive items.

Statistics operators

There are 2 operators tagged with statistics

Emits standard deviation of a stream of numbers.
Emits the z-score for each number of a stream of numbers.

Stream operators

There are 29 operators tagged with stream

Takes a map of items and serializes them into a stream.
Takes a stream of key-value pairs and emits the value with the given key.
Uses an iterator delegate to aggregate items of a stream.
Takes a stream and emits a map of items, selected by given indices.
Collects items from a stream until released.
Counts number of items in a stream of generic items.
Filters a stream letting items pass only if given boolean pass is true.
Sorts a stream of primitive items.
Creates stream containing one single generic item.
Calculates and emits moving average for each number of a stream of numbers.
Concatenates two streams.
Takes a map and emits a stream of key-value pairs.
Releases windows of items collected before.
Takes a streams and emits distinct items.
Reduces the items of a stream pairwise using a reducer delegate.
Emits standard deviation of a stream of numbers.
Sorts a stream, using a comparator delegate specifying the order.
Selects the n-th item in a stream of generic items, n being the index.
Finds the best item using a chooser delegate to decide which item is better.
Emits last item of a stream of generic items.
Cuts a stream into windows of a certain size and emits them.
Emits a sub-stream of another stream.
Takes a map and emits a stream of key-value pairs.
Lets an iterator delegate process a state until the controller tells it to stop.
Transforms a stream by iterating it using an iterator delegate.
Emits first item of a stream of generic items.
Emits the z-score for each number of a stream of numbers.
Filters generic items of a stream, using a filter delegate as decider.
Emits all collected values for multiple streams at once in a given interval.

String operators

There are 8 operators tagged with string

Splits a string at a given separator and emits its pieces as stream.
Tells if a string ends with another string.
Concatenates strings A and B.
Tells if a string begins with another string.
Tells if a string contains another string.
Builds a URL value from given protocol, host, port, path and query string.
Places values formatted in a C-like manner inside a string.
Replaces placeholders in a given string with given values.

Sync operators

There are 2 operators tagged with sync

Tries to acquire semaphore token.
Frees a semaphore token.

Synchronize operators

There are 1 operators tagged with synchronize

Emits all collected values for multiple streams at once in a given interval.

System operators

There are 2 operators tagged with system

Log
Logs any value passed through the configured logger.
Executes a shell command on the host system.

Time operators

There are 7 operators tagged with time

Takes an item and emits it again after a given number of milliseconds has passed.
Now
Emits the current date and time.
Regularly emits a trigger at a given time interval.
Takes a string containing date and time and emits its parsed values.
Takes a UNIX crontab string, sends triggers to its handler delegate accordingly.
Emits the current UNIX timestamp in milliseconds.
Emits triggers using a given crontab.

Window operators

There are 3 operators tagged with window

Cuts a stream into windows of a certain size and emits them.
Releases windows of items collected before.
Collects items from a stream until released.

Zip operators

There are 2 operators tagged with zip

Packs a stream of binary content into a zip archive.
Unpacks a zip archive and emits a stream of files and their binary content.