Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
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
13 changes: 13 additions & 0 deletions hazelcast/asyncio/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,28 @@

__all__ = [
"EntryEventCallable",
"Executor",
"HazelcastClient",
"List",
"Map",
"MultiMap",
"PNCounter",
"Queue",
"ReplicatedMap",
"Ringbuffer",
"Set",
"VectorCollection",
]

from hazelcast.internal.asyncio_client import HazelcastClient
from hazelcast.internal.asyncio_proxy.executor import Executor
from hazelcast.internal.asyncio_proxy.list import List
from hazelcast.internal.asyncio_proxy.map import Map, EntryEventCallable
from hazelcast.internal.asyncio_proxy.multi_map import MultiMap
from hazelcast.internal.asyncio_proxy.pn_counter import PNCounter
from hazelcast.internal.asyncio_proxy.queue import Queue
from hazelcast.internal.asyncio_proxy.replicated_map import ReplicatedMap
from hazelcast.internal.asyncio_proxy.replicated_map import ReplicatedMap
from hazelcast.internal.asyncio_proxy.ringbuffer import Ringbuffer
from hazelcast.internal.asyncio_proxy.set import Set
from hazelcast.internal.asyncio_proxy.vector_collection import VectorCollection
13 changes: 13 additions & 0 deletions hazelcast/internal/asyncio_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
from hazelcast.discovery import HazelcastCloudAddressProvider
from hazelcast.errors import IllegalStateError, InvalidConfigurationError
from hazelcast.internal.asyncio_invocation import InvocationService, Invocation
from hazelcast.internal.asyncio_proxy.pn_counter import PNCounter
from hazelcast.internal.asyncio_proxy.vector_collection import VectorCollection
from hazelcast.lifecycle import LifecycleService, LifecycleState, _InternalLifecycleService
from hazelcast.internal.asyncio_listener import ClusterViewListenerService, ListenerService
Expand All @@ -32,6 +33,7 @@
RINGBUFFER_SERVICE,
SET_SERVICE,
VECTOR_SERVICE,
PN_COUNTER_SERVICE,
)
from hazelcast.internal.asyncio_proxy.base import Proxy
from hazelcast.internal.asyncio_proxy.executor import Executor
Expand Down Expand Up @@ -350,6 +352,17 @@ async def get_ringbuffer(self, name: str) -> Ringbuffer[ItemType]:
"""
return await self._proxy_manager.get_or_create(RINGBUFFER_SERVICE, name)

async def get_pn_counter(self, name: str) -> PNCounter:
"""Returns the PN Counter instance with the specified name.

Args:
name: Name of the PN Counter.

Returns:
Distributed PN Counter instance with the specified name.
"""
return await self._proxy_manager.get_or_create(PN_COUNTER_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 @@ -4,6 +4,7 @@
from hazelcast.internal.asyncio_proxy.executor import create_executor_proxy
from hazelcast.internal.asyncio_proxy.list import create_list_proxy
from hazelcast.internal.asyncio_proxy.multi_map import create_multi_map_proxy
from hazelcast.internal.asyncio_proxy.pn_counter import create_pn_counter_proxy
from hazelcast.internal.asyncio_proxy.queue import create_queue_proxy
from hazelcast.internal.asyncio_proxy.set import create_set_proxy
from hazelcast.internal.asyncio_proxy.vector_collection import (
Expand All @@ -25,6 +26,7 @@
REPLICATED_MAP_SERVICE = "hz:impl:replicatedMapService"
RINGBUFFER_SERVICE = "hz:impl:ringbufferService"
SET_SERVICE = "hz:impl:setService"
PN_COUNTER_SERVICE = "hz:impl:PNCounterService"
VECTOR_SERVICE = "hz:service:vector"

_proxy_init: typing.Dict[
Expand All @@ -39,6 +41,7 @@
REPLICATED_MAP_SERVICE: create_replicated_map_proxy,
RINGBUFFER_SERVICE: create_ringbuffer_proxy,
SET_SERVICE: create_set_proxy,
PN_COUNTER_SERVICE: create_pn_counter_proxy,
VECTOR_SERVICE: create_vector_collection_proxy,
}

Expand Down
Loading
Loading