public function registerJob($identifier, $func, array $options = [])
    {
        if ($func instanceof \Closure) {
            throw new \InvalidArgumentException('Closure is not allowed');
        }
        // Always work on the latest data
        $result = $this->configStorage->lock();
        if ($result === false) {
            return false;
        }
        $this->config = $this->configStorage->load();
        $this->config->registerJob(
            $identifier,
            function ($id) use ($identifier, $func, $options) {
                return new BatchJob($identifier, $func, $id, $options);
            }
        );

        try {
            $result = $this->configStorage->save($this->config);
        } finally {
            $this->configStorage->unlock();
        }
        return $result;
    }