40 lines
641 B
Go
40 lines
641 B
Go
package internal
|
|
|
|
//
|
|
//import (
|
|
// "amuz.es/src/mercury/util/mycrypt"
|
|
// "sync"
|
|
//)
|
|
//
|
|
//type SessionImplPool struct {
|
|
// box mycrypt.SecretBox
|
|
// pool sync.Pool
|
|
// init sync.Once
|
|
//}
|
|
//
|
|
//func (p *SessionImplPool) Acquire() *SessionImpl {
|
|
// p.init.Do(func() {
|
|
// p.pool.New = p.alloc
|
|
// })
|
|
// b := p.pool.Get().(*SessionImpl)
|
|
// return b
|
|
//}
|
|
//
|
|
//func (p *SessionImplPool) alloc() any {
|
|
// impl := &SessionImpl{
|
|
// FBox: p.box,
|
|
// }
|
|
// return impl
|
|
//}
|
|
//
|
|
//func (p *SessionImplPool) Release(b *SessionImpl) {
|
|
// if b == nil {
|
|
// return
|
|
// }
|
|
// b.FData = nil
|
|
// b.FSyncer = nil
|
|
// b.FToken.Clear()
|
|
// b.FUser = nil
|
|
// p.pool.Put(b)
|
|
//}
|