Files
CHORUS/vendor/github.com/francoispqt/gojay/encode_pool.go
anthonyrawlins 9bdcbe0447 Integrate BACKBEAT SDK and resolve KACHING license validation
Major integrations and fixes:
- Added BACKBEAT SDK integration for P2P operation timing
- Implemented beat-aware status tracking for distributed operations
- Added Docker secrets support for secure license management
- Resolved KACHING license validation via HTTPS/TLS
- Updated docker-compose configuration for clean stack deployment
- Disabled rollback policies to prevent deployment failures
- Added license credential storage (CHORUS-DEV-MULTI-001)

Technical improvements:
- BACKBEAT P2P operation tracking with phase management
- Enhanced configuration system with file-based secrets
- Improved error handling for license validation
- Clean separation of KACHING and CHORUS deployment stacks

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-06 07:56:26 +10:00

51 lines
866 B
Go

package gojay
import (
"io"
"sync"
)
var encPool = sync.Pool{
New: func() interface{} {
return NewEncoder(nil)
},
}
var streamEncPool = sync.Pool{
New: func() interface{} {
return Stream.NewEncoder(nil)
},
}
func init() {
for i := 0; i < 32; i++ {
encPool.Put(NewEncoder(nil))
}
for i := 0; i < 32; i++ {
streamEncPool.Put(Stream.NewEncoder(nil))
}
}
// NewEncoder returns a new encoder or borrows one from the pool
func NewEncoder(w io.Writer) *Encoder {
return &Encoder{w: w}
}
// BorrowEncoder borrows an Encoder from the pool.
func BorrowEncoder(w io.Writer) *Encoder {
enc := encPool.Get().(*Encoder)
enc.w = w
enc.buf = enc.buf[:0]
enc.isPooled = 0
enc.err = nil
enc.hasKeys = false
enc.keys = nil
return enc
}
// Release sends back a Encoder to the pool.
func (enc *Encoder) Release() {
enc.isPooled = 1
encPool.Put(enc)
}