func (m *Coordinator) NewLocker(
	ctx context.Context,
	key sync.Key,
) (sync.Locker, error) {
	return &internalLocker{
		key.String(),
		m.locks,
	}, nil
}
NewLocker creates locker of the given key.
package memory
import (
	"context"
	"github.com/moby/locker"
	"github.com/yorkie-team/yorkie/pkg/document/key"
	"github.com/yorkie-team/yorkie/pkg/document/time"
	"github.com/yorkie-team/yorkie/pkg/types"
	"github.com/yorkie-team/yorkie/yorkie/backend/sync"
)
type Coordinator struct {
	agentInfo *sync.AgentInfo
	locks  *locker.Locker
	pubSub *PubSub
}
func NewCoordinator(agentInfo *sync.AgentInfo) *Coordinator {
	return &Coordinator{
		agentInfo: agentInfo,
		locks:     locker.New(),
		pubSub:    NewPubSub(),
	}
}