Econ Service - teeworlds-nats/bridge GitHub Wiki
The core service that serves as the foundation for all operations - where everything begins and ends.
Default Configuration with Example Values
logging: INFO
nats: NatsConfig
econ: {} # Required field - omitting will cause "panic"
# host: 127.0.0.1:8303
# password: econ_password
# auth_message: "Authentication successful" # Default value
# first_commands: [] # Example below
# tasks: [] # Example below
# reconnect:
# max_attempts: 20
# sleep: 10
args: {}
Configuration Examples
First Commands
Commands executed after a successful connection via econ
econ:
host: 127.0.0.1:8303
password: econ_password
first_commands:
- "say Greetings from ByFox"
Scheduled Tasks
nats:
server:
- nats://127.0.0.1:4222
econ:
host: 127.0.0.1:8303
password: econ_password
tasks:
- command: "status"
delay: 10 # Default: 60 seconds
# Can be used as server ping to verify connection stability (recommended)
- command: ""
delay: 5
Custom Path Configuration
nats:
server:
- nats://127.0.0.1:4222
# Custom communication paths
from:
- tw.econ.write.{{message_thread_id}}
- tw.econ.sync
to:
- tw.econ.read.{{message_thread_id}}
econ:
host: 127.0.0.1:8303
password: econ_password
Queue/Sync Operations
nats:
server:
- nats://127.0.0.1:4222
from:
- tw.econ.write.{{message_thread_id}}
# Set queue to "" for processing by all servers rather than just one
- tw.econ.sync
# https://docs.nats.io/nats-concepts/core-nats/queue
queue: "econ.reader" # Default
# queue: "" # Disable queue behavior
econ:
host: 127.0.0.1:8303
password: econ_password