feat: integrate native queue backend into worker and API
- Add QueueBackendNative constant to backend.go - Add case for native queue in NewBackend() switch - Native queue uses same FilesystemPath config - Build tag -tags native_libs enables native implementation Native library integration now complete: - dataset_hash: Worker (hash_selector), CLI (verify auto-hash) - queue_index: Worker/API (backend selection with 'native' type)
This commit is contained in:
parent
25ae791b5c
commit
48d00b8322
1 changed files with 6 additions and 0 deletions
|
|
@ -51,6 +51,7 @@ const (
|
|||
QueueBackendRedis QueueBackend = "redis"
|
||||
QueueBackendSQLite QueueBackend = "sqlite"
|
||||
QueueBackendFS QueueBackend = "filesystem"
|
||||
QueueBackendNative QueueBackend = "native" // Native C++ queue_index (requires -tags native_libs)
|
||||
)
|
||||
|
||||
type BackendConfig struct {
|
||||
|
|
@ -85,6 +86,11 @@ func NewBackend(cfg BackendConfig) (Backend, error) {
|
|||
return nil, fmt.Errorf("filesystem queue path is required")
|
||||
}
|
||||
return NewFilesystemQueue(cfg.FilesystemPath)
|
||||
case QueueBackendNative:
|
||||
if strings.TrimSpace(cfg.FilesystemPath) == "" {
|
||||
return nil, fmt.Errorf("native queue path is required")
|
||||
}
|
||||
return NewNativeQueue(cfg.FilesystemPath)
|
||||
case "", QueueBackendRedis:
|
||||
b, err := NewTaskQueue(Config{
|
||||
RedisAddr: cfg.RedisAddr,
|
||||
|
|
|
|||
Loading…
Reference in a new issue