Distributed Locking
Implement distributed locking in BoxLang applications using Redis to prevent concurrent access issues.
🔒 Overview
📋 Component Syntax
<bx:RedisLock
name="lockName"
cache="redisCacheName"
timeout="2"
expires="60"
throwOnTimeout="true"
bypass="false"
>
<!-- Protected code here -->
</bx:RedisLock>bx:redisLock name="lockName" cache="redisCacheName" timeout=2 expires=60 throwOnTimeout=true bypass=false {
// Protected code here
}⚙️ Attributes
Attribute
Type
Required
Default
Description
💡 Usage Examples
Basic Distributed Lock
Lock with Timeout Handling
Development Bypass
XML Component Syntax
🎯 Common Use Cases
Scheduled Task Coordination
Cache Warming
Database Migration Coordination
Sequential Processing
🔧 Configuration Requirements
Cache Setup
Cluster Configuration
⚠️ Best Practices
Lock Naming
Timeout Configuration
Error Handling
Development vs Production
🚨 Troubleshooting
Lock Not Acquired
Deadlocks
Performance Issues
Cache Not Found
🔍 Monitoring
Lock Metrics
Redis Key Inspection
Last updated
Was this helpful?
