Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion hazelcast/asyncio/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@
warnings.warn("Asyncio API for Hazelcast Python Client is BETA. DO NOT use it in production.")
del warnings

__all__ = ["EntryEventCallable", "HazelcastClient", "Map", "VectorCollection"]
__all__ = ["EntryEventCallable", "HazelcastClient", "Map", "ReplicatedMap", "VectorCollection"]

from hazelcast.internal.asyncio_client import HazelcastClient
from hazelcast.internal.asyncio_proxy.map import Map, EntryEventCallable
from hazelcast.internal.asyncio_proxy.replicated_map import ReplicatedMap
from hazelcast.internal.asyncio_proxy.vector_collection import VectorCollection
14 changes: 14 additions & 0 deletions hazelcast/internal/asyncio_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,12 @@
from hazelcast.internal.asyncio_proxy.manager import (
MAP_SERVICE,
ProxyManager,
REPLICATED_MAP_SERVICE,
VECTOR_SERVICE,
)
from hazelcast.internal.asyncio_proxy.base import Proxy
from hazelcast.internal.asyncio_proxy.map import Map
from hazelcast.internal.asyncio_proxy.replicated_map import ReplicatedMap
from hazelcast.internal.asyncio_reactor import AsyncioReactor
from hazelcast.serialization import SerializationServiceV1
from hazelcast.internal.asyncio_statistics import Statistics
Expand Down Expand Up @@ -259,6 +261,18 @@ async def get_map(self, name: str) -> Map[KeyType, ValueType]:
"""
return await self._proxy_manager.get_or_create(MAP_SERVICE, name)

async def get_replicated_map(self, name: str) -> ReplicatedMap[KeyType, ValueType]:
"""Returns the distributed ReplicatedMap instance with the specified
name.

Args:
name: Name of the distributed replicated map.

Returns:
Distributed ReplicatedMap instance with the specified name.
"""
return await self._proxy_manager.get_or_create(REPLICATED_MAP_SERVICE, name)

async def create_vector_collection_config(
self,
name: str,
Expand Down
3 changes: 3 additions & 0 deletions hazelcast/internal/asyncio_proxy/manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,19 @@
from hazelcast.internal.asyncio_invocation import Invocation
from hazelcast.internal.asyncio_proxy.base import Proxy
from hazelcast.internal.asyncio_proxy.map import create_map_proxy
from hazelcast.internal.asyncio_proxy.replicated_map import create_replicated_map_proxy
from hazelcast.util import to_list

MAP_SERVICE = "hz:impl:mapService"
REPLICATED_MAP_SERVICE = "hz:impl:replicatedMapService"
VECTOR_SERVICE = "hz:service:vector"

_proxy_init: typing.Dict[
str,
typing.Callable[[str, str, typing.Any], typing.Coroutine[typing.Any, typing.Any, typing.Any]],
] = {
MAP_SERVICE: create_map_proxy,
REPLICATED_MAP_SERVICE: create_replicated_map_proxy,
VECTOR_SERVICE: create_vector_collection_proxy,
}

Expand Down
Loading