diff --git a/using-gatewayd/Act.md b/using-gatewayd/Act.md
index 819eb9e..df3101a 100644
--- a/using-gatewayd/Act.md
+++ b/using-gatewayd/Act.md
@@ -9,7 +9,7 @@ parent: Using GatewayD
# Act
-Act, a core component of GatewayD, is a policy engine that supports signals, policies and actions. It is used to automate the execution of business rules. The business rules are currently written as expressions in the [Expr](https://github.com/expr-lang/expr) language, with support for external policy engines to come. The expressions are evaluated against the signals received from the plugins and the corresponding actions are executed if the policy expressions evaluate to true (boolean) or any other type recognized by the action.
+Act, a core component of GatewayD, is a policy engine that supports signals, policies and actions. It enables a range of functionalities by automating the execution of business rules. The business rules are currently written as expressions in the [Expr](https://github.com/expr-lang/expr) language, with support for external policy engines to come. The expressions are evaluated against the signals received from the plugins (and possibly other sources). If the policy expressions evaluate to `true` (boolean) or any other type recognized by the corresponding action, then the action will be executed. Alternatively, Act can publish the result of policy evaluation to a Redis Pub/Sub queue in the [`Output`](https://github.com/gatewayd-io/gatewayd-plugin-sdk/blob/bc5513b395c6622b10db02b6608a972cef909e3d/act/io.go#L18-L24) format. This enables plugins and external systems to subscribe to the events published on that channel and run any arbitrary actions necessary based on the given parameters.
Previously, there were only a single signal, policy and action, called the `terminatePolicy`, which were hard-coded into the GatewayD codebase. This made it difficult to extend and customize the behavior of GatewayD. With the new Act, based on [this proposal](https://github.com/gatewayd-io/proposals/issues/5), the signals, policies and actions are pluggable and can be extended to support custom requirements. This opens up a wide range of possibilities for customizing the behavior of GatewayD to suit the needs of different use cases. For example, a policy can be written to check if the request is coming from a specific IP address, and if so, the action can be to terminate the request.
@@ -86,7 +86,10 @@ The `Hook` field is a map that contains the following fields:
## Actions
-The action can be run in sync or async mode, and it can return a result or an error. The actions are executed if the policy expressions evaluate to true (boolean) or any other type recognized by the action. The actions have the following fields:
+The action can be run in sync or async mode, and it can return a result or an error.
+Async actions can be configured to be published to a Redis channel instead of running in a background goroutine.
+To configure Act to publish async actions to a Redis channel, use `actionRedis` value of [general configuration](/using-gatewayd/plugins-configuration/general-configurations#Configuration parameters)
+The actions are executed, or published, if the policy expressions evaluate to true (boolean) or any other type recognized by the action. The actions have the following fields:
1. `name`: The name of the action, such as `terminate`, `log`, etc.
2. `metadata`: The metadata associated with the action, such as the log message and log level.
diff --git a/using-gatewayd/plugins-configuration/general-configurations.md b/using-gatewayd/plugins-configuration/general-configurations.md
index c91f7ac..6cad073 100644
--- a/using-gatewayd/plugins-configuration/general-configurations.md
+++ b/using-gatewayd/plugins-configuration/general-configurations.md
@@ -1,5 +1,5 @@
---
-last_modified_date: 2024-05-31 20:16:38
+last_modified_date: 2024-06-03 22:00:55
layout: default
title: General configurations
description: General configurations for plugins
@@ -12,18 +12,22 @@ grand_parent: Using GatewayD
## Configuration parameters
-| Name | Type | Default value | Possible values | Description |
-| ------------------- | ------- | ------------- | ---------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
-| compatibilityPolicy | string | strict | strict, loose | The compatibility policy controls how GatewayD treats plugins' requirements. If a plugin requires a specific version of another plugin, the compatibility policy controls whether to allow or reject the plugin.
- strict (default): the plugin is rejected if it requires a specific version of another plugin and that version is not the one currently loaded.
- loose: the plugin is allowed to run even if it requires a specific version of another plugin and that version is not the one currently loaded. |
-| enableMetricsMerger | boolean | True | True, False | If enabled, GatewayD will merge the Prometheus metrics of all plugins over Unix domain socket. The metrics are merged and exposed via the GatewayD [metrics](/global-configuration/metrics) endpoint via HTTP. |
-| metricsMergerPeriod | string | 5s | Valid duration strings | The metrics merger period controls how often the metrics merger should collect and merge metrics from plugins. |
-| healthCheckPeriod | string | 5s | Valid duration strings | The health check period controls how often the health check should be performed. The health check is performed by pinging each plugin. Unhealthy plugins are removed. |
-| reloadOnCrash | boolean | True | True, False | If enabled, GatewayD will reload the plugin if it crashes. The crash is detected by the health check. |
-| timeout | string | 30s | Valid duration strings | The timeout controls how long to wait for a plugin to respond to a request before timing out. |
-| startTimeout | string | 1m | Valid duration strings | The start timeout controls how long to wait for a plugin to start before timing out. |
-| policyTimeout | string | 30s | Valid duration strings | The policy timeout controls how long to wait for a policy to evaluate before timing out. |
-| policies | array | [] | An array of objects | The policies are a set of rules that are evaluated against the signals to determine whether the actions should be executed. |
-| actionTimeout | string | 30s | Valid duration strings | The action timeout will set a default timeout for all the actions that are going to be executed. Action specific timeout has priority over this value. Set to `0` to remove default action timeout. |
+| Name | Type | Default value | Possible values | Description |
+| ------------------- | ------- | ---------------- | ---------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
+| compatibilityPolicy | string | strict | strict, loose | The compatibility policy controls how GatewayD treats plugins' requirements. If a plugin requires a specific version of another plugin, the compatibility policy controls whether to allow or reject the plugin.
- strict (default): the plugin is rejected if it requires a specific version of another plugin and that version is not the one currently loaded.
- loose: the plugin is allowed to run even if it requires a specific version of another plugin and that version is not the one currently loaded. |
+| enableMetricsMerger | boolean | True | True, False | If enabled, GatewayD will merge the Prometheus metrics of all plugins over Unix domain socket. The metrics are merged and exposed via the GatewayD [metrics](/global-configuration/metrics) endpoint via HTTP. |
+| metricsMergerPeriod | string | 5s | Valid duration strings | The metrics merger period controls how often the metrics merger should collect and merge metrics from plugins. |
+| healthCheckPeriod | string | 5s | Valid duration strings | The health check period controls how often the health check should be performed. The health check is performed by pinging each plugin. Unhealthy plugins are removed. |
+| reloadOnCrash | boolean | True | True, False | If enabled, GatewayD will reload the plugin if it crashes. The crash is detected by the health check. |
+| timeout | string | 30s | Valid duration strings | The timeout controls how long to wait for a plugin to respond to a request before timing out. |
+| startTimeout | string | 1m | Valid duration strings | The start timeout controls how long to wait for a plugin to start before timing out. |
+| policyTimeout | string | 30s | Valid duration strings | The policy timeout controls how long to wait for a policy to evaluate before timing out. |
+| policies | array | [] | An array of objects | The policies are a set of rules that are evaluated against the signals to determine whether the actions should be executed. |
+| actionTimeout | string | 30s | Valid duration strings | The actionTimeout will set a default timeout for all the actions that are going to be executed. Action specific timeout has priority over this value. Set to `0` to remove default action timeout. |
+| actionRedis | object | | | The actionRedis provides a Redis connection to be used by Act system to publish async actions to. If not given, or not enabled, async actions will run in a background goroutine. |
+| actionRedis.enabled | boolean | False | True, False | If enabled, will use configuration to connect to a Redis Pub/Sub channel and publish async actions data. |
+| actionRedis.address | string | localhost:6379 | Valid Redis connection url | URL used to connect to async action Redis. |
+| actionRedis.channel | string | gatewayd-actions | Any valid Redis channel name | Name of the channel that async actions will be published to. |
## Example configuration
@@ -42,4 +46,8 @@ policies:
policy: "Signal.terminate == true && Policy.terminate == 'stop'"
metadata:
terminate: "stop" # Change this to "continue" to continue the execution
+actionRedis:
+ enabled: True
+ address: localhost:6379
+ channel: gatewayd-actions
```