Island: Register pypubsub Publisher in the DIContainer

This commit is contained in:
Mike Salvatore 2022-08-10 07:31:43 -04:00
parent 416cb30577
commit d09f743100
1 changed files with 3 additions and 2 deletions

View File

@ -3,7 +3,7 @@ import logging
from pathlib import Path from pathlib import Path
from typing import Sequence from typing import Sequence
from pubsub import pub from pubsub.core import Publisher
from pymongo import MongoClient from pymongo import MongoClient
from common import DIContainer from common import DIContainer
@ -74,7 +74,8 @@ def initialize_services(data_dir: Path) -> DIContainer:
ILockableEncryptor, RepositoryEncryptor(data_dir / REPOSITORY_KEY_FILE_NAME) ILockableEncryptor, RepositoryEncryptor(data_dir / REPOSITORY_KEY_FILE_NAME)
) )
container.register_instance(Version, container.resolve(Version)) container.register_instance(Version, container.resolve(Version))
container.register_instance(IEventQueue, PyPubSubEventQueue(pub)) container.register(Publisher, Publisher)
container.register_instance(IEventQueue, container.resolve(PyPubSubEventQueue))
_register_repositories(container, data_dir) _register_repositories(container, data_dir)
_register_services(container) _register_services(container)