Spanner/src/Session/CacheSessionPool.php
public function release(Session $session)
    {
        $this->config['lock']->synchronize(function () use ($session) {
            $item = $this->cacheItemPool->getItem($this->cacheKey);
            $data = $item->get();
            $name = $session->name();

            if (isset($data['inUse'][$name])) {
                unset($data['inUse'][$name]);
                array_push($data['queue'], [
                    'name' => $name,
                    'expiration' => $session->expiration()
                        ?: $this->time() + SessionPoolInterface::SESSION_EXPIRATION_SECONDS
                ]);
                $this->cacheItemPool->save($item->set($data));
            }
        });
    }
public function release(Session $session)
    {
        $this->config['lock']->synchronize(function () use ($session) {
            $item = $this->cacheItemPool->getItem($this->cacheKey);
            $data = $item->get();
            $name = $session->name();

            if (isset($data['inUse'][$name])) {
                unset($data['inUse'][$name]);
                array_push($data['queue'], [
                    'name' => $name,
                    'expiration' => $session->expiration()
                        ?: $this->time() + SessionPoolInterface::SESSION_EXPIRATION_SECONDS
                ]);
                $this->cacheItemPool->save($item->set($data));
            }
        });
    }
public function release ( Session $ session ) { $ this -> config [ 'lock' ] -> synchronize ( function ( ) use ( $ session ) { $ item = $ this -> cacheItemPool -> getItem ( $ this -> cacheKey ) ; $ data = $ item -> get ( ) ; $ name = $ session -> name ( ) ; if ( isset ( $ data [ 'inUse' ] [ $ name ] ) ) { unset ( $ data [ 'inUse' ] [ $ name ] ) ; array_push ( $ data [ 'queue' ] , [ 'name' => $ name , 'expiration' => $ session -> expiration ( ) ? : $ this -> time ( ) + SessionPoolInterface :: SESSION_EXPIRATION_SECONDS ] ) ; $ this -> cacheItemPool -> save ( $ item -> set ( $ data ) ) ; } } ) ; }
Release a session back to the pool.

@param Session $session The session.
Release a session back to the pool .