public SubscriptionActor(Guid documentId, DocumentHub hub)
 {
     if (hub == null)
     {
         throw new ArgumentNullException(nameof(hub));
     }
     _documentId = documentId;
     _hub        = hub;
     Ready();
 }
        public DocumentHub GetOrStartHubForDocumentOfId(string documentGuid)
        {
            if (!Hubs.ContainsKey(documentGuid))
            {
                var newHub = new DocumentHub();
                DocumentSystemActors.ActorSystem.ActorOf(Props.Create(() => new SubscriptionActor(Guid.Parse(documentGuid), newHub)));
                Hubs.TryAdd(documentGuid, newHub);
            }

            Hubs.TryGetValue(documentGuid, out var hub);
            return(hub);
        }