wool 0.1rc7__py3-none-any.whl → 0.1rc9__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of wool might be problematic. Click here for more details.
- wool/_mempool/__init__.py +2 -1
- wool/_mempool/_client.py +167 -0
- wool/_mempool/_mempool.py +215 -108
- wool/_mempool/{_metadata/__init__.py → _metadata.py} +8 -14
- wool/_mempool/_service.py +227 -0
- wool/_protobuf/__init__.py +11 -0
- wool/_protobuf/{_mempool/_metadata/_metadata_pb2.py → mempool/metadata_pb2.py} +8 -8
- wool/_protobuf/{_mempool/_metadata/_metadata_pb2.pyi → mempool/metadata_pb2.pyi} +1 -1
- wool/_protobuf/mempool/metadata_pb2_grpc.py +24 -0
- wool/_protobuf/mempool/service_pb2.py +66 -0
- wool/_protobuf/mempool/service_pb2.pyi +108 -0
- wool/_protobuf/mempool/service_pb2_grpc.py +355 -0
- {wool-0.1rc7.dist-info → wool-0.1rc9.dist-info}/METADATA +8 -2
- wool-0.1rc9.dist-info/RECORD +29 -0
- wool/_protobuf/.gitkeep +0 -0
- wool-0.1rc7.dist-info/RECORD +0 -23
- {wool-0.1rc7.dist-info → wool-0.1rc9.dist-info}/WHEEL +0 -0
- {wool-0.1rc7.dist-info → wool-0.1rc9.dist-info}/entry_points.txt +0 -0
|
@@ -0,0 +1,227 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
import asyncio
|
|
4
|
+
from typing import AsyncGenerator
|
|
5
|
+
from typing import Final
|
|
6
|
+
from weakref import WeakSet
|
|
7
|
+
from weakref import WeakValueDictionary
|
|
8
|
+
|
|
9
|
+
import shortuuid
|
|
10
|
+
from grpc.aio import ServicerContext
|
|
11
|
+
|
|
12
|
+
from wool._mempool import MemoryPool
|
|
13
|
+
|
|
14
|
+
try:
|
|
15
|
+
from wool._protobuf.mempool import service_pb2 as pb
|
|
16
|
+
from wool._protobuf.mempool import service_pb2_grpc as rpc
|
|
17
|
+
except ImportError as e:
|
|
18
|
+
from wool._protobuf import ProtobufImportError
|
|
19
|
+
|
|
20
|
+
raise ProtobufImportError(e) from e
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
class _Session:
|
|
24
|
+
id: Final[str]
|
|
25
|
+
queue: Final[asyncio.Queue[pb.SessionResponse]]
|
|
26
|
+
references: Final[set[_Reference]]
|
|
27
|
+
|
|
28
|
+
_sessions: Final[WeakValueDictionary[str, _Session]] = (
|
|
29
|
+
WeakValueDictionary()
|
|
30
|
+
)
|
|
31
|
+
|
|
32
|
+
@classmethod
|
|
33
|
+
def get(cls, id: str) -> _Session | None:
|
|
34
|
+
return cls._sessions.get(id)
|
|
35
|
+
|
|
36
|
+
def __init__(self):
|
|
37
|
+
self.id = shortuuid.uuid()
|
|
38
|
+
self.queue = asyncio.Queue()
|
|
39
|
+
self.references = set()
|
|
40
|
+
self._sessions[self.id] = self
|
|
41
|
+
|
|
42
|
+
def __eq__(self, other) -> bool:
|
|
43
|
+
if isinstance(other, _Session):
|
|
44
|
+
return self.id == other.id
|
|
45
|
+
return False
|
|
46
|
+
|
|
47
|
+
def __hash__(self) -> int:
|
|
48
|
+
return hash(self.id)
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
class _Reference:
|
|
52
|
+
id: Final[str]
|
|
53
|
+
sessions: Final[WeakSet[_Session]]
|
|
54
|
+
|
|
55
|
+
_mempool: Final[MemoryPool]
|
|
56
|
+
_references: Final[WeakValueDictionary[str, _Reference]] = (
|
|
57
|
+
WeakValueDictionary()
|
|
58
|
+
)
|
|
59
|
+
_to_delete: Final[set[str]] = set()
|
|
60
|
+
_initialized: bool = False
|
|
61
|
+
|
|
62
|
+
@classmethod
|
|
63
|
+
def get(cls, id: str) -> _Reference | None:
|
|
64
|
+
return cls._references.get(id)
|
|
65
|
+
|
|
66
|
+
@classmethod
|
|
67
|
+
def new(cls, id: str, *, mempool: MemoryPool) -> _Reference:
|
|
68
|
+
if id in cls._references:
|
|
69
|
+
raise ValueError(f"Reference {id} already exists")
|
|
70
|
+
return cls(id, mempool=mempool)
|
|
71
|
+
|
|
72
|
+
def __new__(cls, id: str, *, mempool: MemoryPool):
|
|
73
|
+
if id in cls._references:
|
|
74
|
+
if id in cls._to_delete:
|
|
75
|
+
cls._to_delete.remove(id)
|
|
76
|
+
return cls._references[id]
|
|
77
|
+
return super().__new__(cls)
|
|
78
|
+
|
|
79
|
+
def __init__(self, id: str, *, mempool: MemoryPool):
|
|
80
|
+
if not self._initialized:
|
|
81
|
+
self.id = id
|
|
82
|
+
self.sessions = WeakSet()
|
|
83
|
+
self._mempool = mempool
|
|
84
|
+
self._references[id] = self
|
|
85
|
+
self._initialized = True
|
|
86
|
+
|
|
87
|
+
def __eq__(self, other) -> bool:
|
|
88
|
+
if isinstance(other, _Reference):
|
|
89
|
+
return self.id == other.id
|
|
90
|
+
return False
|
|
91
|
+
|
|
92
|
+
def __hash__(self) -> int:
|
|
93
|
+
return hash(self.id)
|
|
94
|
+
|
|
95
|
+
def __del__(self):
|
|
96
|
+
self._to_delete.add(self.id)
|
|
97
|
+
|
|
98
|
+
async def _delete(id, to_delete, mempool):
|
|
99
|
+
if id in to_delete:
|
|
100
|
+
try:
|
|
101
|
+
to_delete.remove(id)
|
|
102
|
+
await mempool.delete(id)
|
|
103
|
+
except FileNotFoundError:
|
|
104
|
+
pass
|
|
105
|
+
|
|
106
|
+
try:
|
|
107
|
+
asyncio.get_running_loop().create_task(
|
|
108
|
+
_delete(self.id, self._to_delete, self._mempool)
|
|
109
|
+
)
|
|
110
|
+
except RuntimeError:
|
|
111
|
+
asyncio.new_event_loop().run_until_complete(
|
|
112
|
+
_delete(self.id, self._to_delete, self._mempool)
|
|
113
|
+
)
|
|
114
|
+
|
|
115
|
+
|
|
116
|
+
class MemoryPoolService(rpc.MemoryPoolServicer):
|
|
117
|
+
def __init__(self, mempool: MemoryPool | None = None):
|
|
118
|
+
self._mempool = mempool or MemoryPool()
|
|
119
|
+
self._shutdown = asyncio.Event()
|
|
120
|
+
|
|
121
|
+
async def session(
|
|
122
|
+
self, request: pb.SessionRequest, context: ServicerContext
|
|
123
|
+
) -> AsyncGenerator[pb.SessionResponse]:
|
|
124
|
+
session = _Session()
|
|
125
|
+
yield pb.SessionResponse(session=pb.Session(id=session.id))
|
|
126
|
+
while True:
|
|
127
|
+
yield await session.queue.get()
|
|
128
|
+
|
|
129
|
+
async def map(
|
|
130
|
+
self, request: pb.AcquireRequest, context: ServicerContext
|
|
131
|
+
) -> pb.AcquireResponse:
|
|
132
|
+
if not (session := _Session.get(request.session.id)):
|
|
133
|
+
raise ValueError(f"Session {request.session.id} not found")
|
|
134
|
+
await self._mempool.map(request.reference.id or None)
|
|
135
|
+
reference = _Reference(request.reference.id, mempool=self._mempool)
|
|
136
|
+
await self.acquire(
|
|
137
|
+
pb.AcquireRequest(
|
|
138
|
+
session=pb.Session(id=session.id),
|
|
139
|
+
reference=pb.Reference(id=reference.id),
|
|
140
|
+
),
|
|
141
|
+
context,
|
|
142
|
+
)
|
|
143
|
+
return pb.AcquireResponse()
|
|
144
|
+
|
|
145
|
+
async def put(
|
|
146
|
+
self, request: pb.PutRequest, context: ServicerContext
|
|
147
|
+
) -> pb.PutResponse:
|
|
148
|
+
if not (session := _Session.get(request.session.id)):
|
|
149
|
+
raise ValueError(f"Session {request.session.id} not found")
|
|
150
|
+
reference = _Reference(
|
|
151
|
+
id=await self._mempool.put(request.dump, mutable=request.mutable),
|
|
152
|
+
mempool=self._mempool,
|
|
153
|
+
)
|
|
154
|
+
await self.acquire(
|
|
155
|
+
pb.AcquireRequest(
|
|
156
|
+
session=pb.Session(id=session.id),
|
|
157
|
+
reference=pb.Reference(id=reference.id),
|
|
158
|
+
),
|
|
159
|
+
context,
|
|
160
|
+
)
|
|
161
|
+
return pb.PutResponse(reference=pb.Reference(id=reference.id))
|
|
162
|
+
|
|
163
|
+
async def get(
|
|
164
|
+
self, request: pb.GetRequest, context: ServicerContext
|
|
165
|
+
) -> pb.GetResponse:
|
|
166
|
+
if not (session := _Session.get(request.session.id)):
|
|
167
|
+
raise ValueError(f"Session {request.session.id} not found")
|
|
168
|
+
if _Reference.get(request.reference.id) is None:
|
|
169
|
+
await self.acquire(
|
|
170
|
+
pb.AcquireRequest(
|
|
171
|
+
session=pb.Session(id=session.id),
|
|
172
|
+
reference=pb.Reference(id=request.reference.id),
|
|
173
|
+
),
|
|
174
|
+
context,
|
|
175
|
+
)
|
|
176
|
+
dump = await self._mempool.get(request.reference.id)
|
|
177
|
+
return pb.GetResponse(dump=dump)
|
|
178
|
+
|
|
179
|
+
async def post(
|
|
180
|
+
self, request: pb.PostRequest, context: ServicerContext
|
|
181
|
+
) -> pb.PostResponse:
|
|
182
|
+
if not (session := _Session.get(request.session.id)):
|
|
183
|
+
raise ValueError(f"Session {request.session.id} not found")
|
|
184
|
+
if not (reference := _Reference.get(request.reference.id)):
|
|
185
|
+
raise ValueError(f"Reference {request.reference.id} not found")
|
|
186
|
+
if reference not in session.references:
|
|
187
|
+
await self.acquire(
|
|
188
|
+
pb.AcquireRequest(
|
|
189
|
+
session=pb.Session(id=session.id),
|
|
190
|
+
reference=pb.Reference(id=reference.id),
|
|
191
|
+
),
|
|
192
|
+
context,
|
|
193
|
+
)
|
|
194
|
+
updated = await self._mempool.post(request.reference.id, request.dump)
|
|
195
|
+
if updated:
|
|
196
|
+
for session in _Reference(
|
|
197
|
+
id=request.reference.id, mempool=self._mempool
|
|
198
|
+
).sessions:
|
|
199
|
+
if session.id is not request.session.id:
|
|
200
|
+
event = pb.Event(
|
|
201
|
+
reference=request.reference,
|
|
202
|
+
event_type="post",
|
|
203
|
+
)
|
|
204
|
+
await session.queue.put(pb.SessionResponse(event=event))
|
|
205
|
+
return pb.PostResponse(updated=updated)
|
|
206
|
+
|
|
207
|
+
async def acquire(
|
|
208
|
+
self, request: pb.AcquireRequest, context: ServicerContext
|
|
209
|
+
) -> pb.AcquireResponse:
|
|
210
|
+
if not (session := _Session.get(request.session.id)):
|
|
211
|
+
raise ValueError(f"Session {request.session.id} not found")
|
|
212
|
+
if not (reference := _Reference.get(request.reference.id)):
|
|
213
|
+
raise ValueError(f"Reference {request.reference.id} not found")
|
|
214
|
+
session.references.add(reference)
|
|
215
|
+
reference.sessions.add(session)
|
|
216
|
+
return pb.AcquireResponse()
|
|
217
|
+
|
|
218
|
+
async def release(
|
|
219
|
+
self, request: pb.ReleaseRequest, context: ServicerContext
|
|
220
|
+
) -> pb.ReleaseResponse:
|
|
221
|
+
if not (session := _Session.get(request.session.id)):
|
|
222
|
+
raise ValueError(f"Session {request.session.id} not found")
|
|
223
|
+
if not (reference := _Reference.get(request.reference.id)):
|
|
224
|
+
raise ValueError(f"Reference {request.reference.id} not found")
|
|
225
|
+
session.references.remove(reference)
|
|
226
|
+
reference.sessions.remove(session)
|
|
227
|
+
return pb.ReleaseResponse()
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import os
|
|
2
|
+
import sys
|
|
3
|
+
|
|
4
|
+
sys.path.insert(0, os.path.abspath(os.path.dirname(__file__)))
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
class ProtobufImportError(ImportError):
|
|
8
|
+
def __init__(self, exception: ImportError):
|
|
9
|
+
super().__init__(
|
|
10
|
+
f"{str(exception)} - ensure protocol buffers are compiled."
|
|
11
|
+
)
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
# -*- coding: utf-8 -*-
|
|
2
2
|
# Generated by the protocol buffer compiler. DO NOT EDIT!
|
|
3
3
|
# NO CHECKED-IN PROTOBUF GENCODE
|
|
4
|
-
# source:
|
|
5
|
-
# Protobuf Python Version: 6.
|
|
4
|
+
# source: mempool/metadata.proto
|
|
5
|
+
# Protobuf Python Version: 6.31.0
|
|
6
6
|
"""Generated protocol buffer code."""
|
|
7
7
|
from google.protobuf import descriptor as _descriptor
|
|
8
8
|
from google.protobuf import descriptor_pool as _descriptor_pool
|
|
@@ -12,10 +12,10 @@ from google.protobuf.internal import builder as _builder
|
|
|
12
12
|
_runtime_version.ValidateProtobufRuntimeVersion(
|
|
13
13
|
_runtime_version.Domain.PUBLIC,
|
|
14
14
|
6,
|
|
15
|
-
|
|
15
|
+
31,
|
|
16
16
|
0,
|
|
17
17
|
'',
|
|
18
|
-
'
|
|
18
|
+
'mempool/metadata.proto'
|
|
19
19
|
)
|
|
20
20
|
# @@protoc_insertion_point(imports)
|
|
21
21
|
|
|
@@ -24,13 +24,13 @@ _sym_db = _symbol_database.Default()
|
|
|
24
24
|
|
|
25
25
|
|
|
26
26
|
|
|
27
|
-
DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\
|
|
27
|
+
DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x16mempool/metadata.proto\x12\x16wool._protobuf.mempool\"J\n\x0fMetadataMessage\x12\x0b\n\x03ref\x18\x01 \x01(\t\x12\x0f\n\x07mutable\x18\x02 \x01(\x08\x12\x0c\n\x04size\x18\x03 \x01(\x03\x12\x0b\n\x03md5\x18\x04 \x01(\x0c\x62\x06proto3')
|
|
28
28
|
|
|
29
29
|
_globals = globals()
|
|
30
30
|
_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals)
|
|
31
|
-
_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, '
|
|
31
|
+
_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'mempool.metadata_pb2', _globals)
|
|
32
32
|
if not _descriptor._USE_C_DESCRIPTORS:
|
|
33
33
|
DESCRIPTOR._loaded_options = None
|
|
34
|
-
_globals['
|
|
35
|
-
_globals['
|
|
34
|
+
_globals['_METADATAMESSAGE']._serialized_start=50
|
|
35
|
+
_globals['_METADATAMESSAGE']._serialized_end=124
|
|
36
36
|
# @@protoc_insertion_point(module_scope)
|
|
@@ -4,7 +4,7 @@ from typing import ClassVar as _ClassVar, Optional as _Optional
|
|
|
4
4
|
|
|
5
5
|
DESCRIPTOR: _descriptor.FileDescriptor
|
|
6
6
|
|
|
7
|
-
class
|
|
7
|
+
class MetadataMessage(_message.Message):
|
|
8
8
|
__slots__ = ("ref", "mutable", "size", "md5")
|
|
9
9
|
REF_FIELD_NUMBER: _ClassVar[int]
|
|
10
10
|
MUTABLE_FIELD_NUMBER: _ClassVar[int]
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
|
|
2
|
+
"""Client and server classes corresponding to protobuf-defined services."""
|
|
3
|
+
import grpc
|
|
4
|
+
import warnings
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
GRPC_GENERATED_VERSION = '1.73.1'
|
|
8
|
+
GRPC_VERSION = grpc.__version__
|
|
9
|
+
_version_not_supported = False
|
|
10
|
+
|
|
11
|
+
try:
|
|
12
|
+
from grpc._utilities import first_version_is_lower
|
|
13
|
+
_version_not_supported = first_version_is_lower(GRPC_VERSION, GRPC_GENERATED_VERSION)
|
|
14
|
+
except ImportError:
|
|
15
|
+
_version_not_supported = True
|
|
16
|
+
|
|
17
|
+
if _version_not_supported:
|
|
18
|
+
raise RuntimeError(
|
|
19
|
+
f'The grpc package installed is at version {GRPC_VERSION},'
|
|
20
|
+
+ f' but the generated code in mempool/metadata_pb2_grpc.py depends on'
|
|
21
|
+
+ f' grpcio>={GRPC_GENERATED_VERSION}.'
|
|
22
|
+
+ f' Please upgrade your grpc module to grpcio>={GRPC_GENERATED_VERSION}'
|
|
23
|
+
+ f' or downgrade your generated code using grpcio-tools<={GRPC_VERSION}.'
|
|
24
|
+
)
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
# -*- coding: utf-8 -*-
|
|
2
|
+
# Generated by the protocol buffer compiler. DO NOT EDIT!
|
|
3
|
+
# NO CHECKED-IN PROTOBUF GENCODE
|
|
4
|
+
# source: mempool/service.proto
|
|
5
|
+
# Protobuf Python Version: 6.31.0
|
|
6
|
+
"""Generated protocol buffer code."""
|
|
7
|
+
from google.protobuf import descriptor as _descriptor
|
|
8
|
+
from google.protobuf import descriptor_pool as _descriptor_pool
|
|
9
|
+
from google.protobuf import runtime_version as _runtime_version
|
|
10
|
+
from google.protobuf import symbol_database as _symbol_database
|
|
11
|
+
from google.protobuf.internal import builder as _builder
|
|
12
|
+
_runtime_version.ValidateProtobufRuntimeVersion(
|
|
13
|
+
_runtime_version.Domain.PUBLIC,
|
|
14
|
+
6,
|
|
15
|
+
31,
|
|
16
|
+
0,
|
|
17
|
+
'',
|
|
18
|
+
'mempool/service.proto'
|
|
19
|
+
)
|
|
20
|
+
# @@protoc_insertion_point(imports)
|
|
21
|
+
|
|
22
|
+
_sym_db = _symbol_database.Default()
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x15mempool/service.proto\x12\x16wool._protobuf.mempool\"\x10\n\x0eSessionRequest\"\x81\x01\n\x0fSessionResponse\x12\x32\n\x07session\x18\x01 \x01(\x0b\x32\x1f.wool._protobuf.mempool.SessionH\x00\x12.\n\x05\x65vent\x18\x02 \x01(\x0b\x32\x1d.wool._protobuf.mempool.EventH\x00\x42\n\n\x08response\"x\n\x0e\x41\x63quireRequest\x12\x34\n\treference\x18\x01 \x01(\x0b\x32!.wool._protobuf.mempool.Reference\x12\x30\n\x07session\x18\x02 \x01(\x0b\x32\x1f.wool._protobuf.mempool.Session\"\x11\n\x0f\x41\x63quireResponse\"]\n\nPutRequest\x12\x30\n\x07session\x18\x01 \x01(\x0b\x32\x1f.wool._protobuf.mempool.Session\x12\x0f\n\x07mutable\x18\x02 \x01(\x08\x12\x0c\n\x04\x64ump\x18\x03 \x01(\x0c\"C\n\x0bPutResponse\x12\x34\n\treference\x18\x01 \x01(\x0b\x32!.wool._protobuf.mempool.Reference\"\x83\x01\n\x0bPostRequest\x12\x30\n\x07session\x18\x01 \x01(\x0b\x32\x1f.wool._protobuf.mempool.Session\x12\x34\n\treference\x18\x02 \x01(\x0b\x32!.wool._protobuf.mempool.Reference\x12\x0c\n\x04\x64ump\x18\x03 \x01(\x0c\"\x1f\n\x0cPostResponse\x12\x0f\n\x07updated\x18\x01 \x01(\x08\"t\n\nGetRequest\x12\x34\n\treference\x18\x01 \x01(\x0b\x32!.wool._protobuf.mempool.Reference\x12\x30\n\x07session\x18\x02 \x01(\x0b\x32\x1f.wool._protobuf.mempool.Session\"\x1b\n\x0bGetResponse\x12\x0c\n\x04\x64ump\x18\x01 \x01(\x0c\"x\n\x0eReleaseRequest\x12\x34\n\treference\x18\x01 \x01(\x0b\x32!.wool._protobuf.mempool.Reference\x12\x30\n\x07session\x18\x02 \x01(\x0b\x32\x1f.wool._protobuf.mempool.Session\"\x11\n\x0fReleaseResponse\"\x17\n\tReference\x12\n\n\x02id\x18\x01 \x01(\t\"\x15\n\x07Session\x12\n\n\x02id\x18\x01 \x01(\t\"Q\n\x05\x45vent\x12\x34\n\treference\x18\x01 \x01(\x0b\x32!.wool._protobuf.mempool.Reference\x12\x12\n\nevent_type\x18\x02 \x01(\t2\xed\x04\n\nMemoryPool\x12\\\n\x07session\x12&.wool._protobuf.mempool.SessionRequest\x1a\'.wool._protobuf.mempool.SessionResponse0\x01\x12Z\n\x07\x61\x63quire\x12&.wool._protobuf.mempool.AcquireRequest\x1a\'.wool._protobuf.mempool.AcquireResponse\x12V\n\x03map\x12&.wool._protobuf.mempool.AcquireRequest\x1a\'.wool._protobuf.mempool.AcquireResponse\x12N\n\x03put\x12\".wool._protobuf.mempool.PutRequest\x1a#.wool._protobuf.mempool.PutResponse\x12Q\n\x04post\x12#.wool._protobuf.mempool.PostRequest\x1a$.wool._protobuf.mempool.PostResponse\x12N\n\x03get\x12\".wool._protobuf.mempool.GetRequest\x1a#.wool._protobuf.mempool.GetResponse\x12Z\n\x07release\x12&.wool._protobuf.mempool.ReleaseRequest\x1a\'.wool._protobuf.mempool.ReleaseResponseb\x06proto3')
|
|
28
|
+
|
|
29
|
+
_globals = globals()
|
|
30
|
+
_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals)
|
|
31
|
+
_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'mempool.service_pb2', _globals)
|
|
32
|
+
if not _descriptor._USE_C_DESCRIPTORS:
|
|
33
|
+
DESCRIPTOR._loaded_options = None
|
|
34
|
+
_globals['_SESSIONREQUEST']._serialized_start=49
|
|
35
|
+
_globals['_SESSIONREQUEST']._serialized_end=65
|
|
36
|
+
_globals['_SESSIONRESPONSE']._serialized_start=68
|
|
37
|
+
_globals['_SESSIONRESPONSE']._serialized_end=197
|
|
38
|
+
_globals['_ACQUIREREQUEST']._serialized_start=199
|
|
39
|
+
_globals['_ACQUIREREQUEST']._serialized_end=319
|
|
40
|
+
_globals['_ACQUIRERESPONSE']._serialized_start=321
|
|
41
|
+
_globals['_ACQUIRERESPONSE']._serialized_end=338
|
|
42
|
+
_globals['_PUTREQUEST']._serialized_start=340
|
|
43
|
+
_globals['_PUTREQUEST']._serialized_end=433
|
|
44
|
+
_globals['_PUTRESPONSE']._serialized_start=435
|
|
45
|
+
_globals['_PUTRESPONSE']._serialized_end=502
|
|
46
|
+
_globals['_POSTREQUEST']._serialized_start=505
|
|
47
|
+
_globals['_POSTREQUEST']._serialized_end=636
|
|
48
|
+
_globals['_POSTRESPONSE']._serialized_start=638
|
|
49
|
+
_globals['_POSTRESPONSE']._serialized_end=669
|
|
50
|
+
_globals['_GETREQUEST']._serialized_start=671
|
|
51
|
+
_globals['_GETREQUEST']._serialized_end=787
|
|
52
|
+
_globals['_GETRESPONSE']._serialized_start=789
|
|
53
|
+
_globals['_GETRESPONSE']._serialized_end=816
|
|
54
|
+
_globals['_RELEASEREQUEST']._serialized_start=818
|
|
55
|
+
_globals['_RELEASEREQUEST']._serialized_end=938
|
|
56
|
+
_globals['_RELEASERESPONSE']._serialized_start=940
|
|
57
|
+
_globals['_RELEASERESPONSE']._serialized_end=957
|
|
58
|
+
_globals['_REFERENCE']._serialized_start=959
|
|
59
|
+
_globals['_REFERENCE']._serialized_end=982
|
|
60
|
+
_globals['_SESSION']._serialized_start=984
|
|
61
|
+
_globals['_SESSION']._serialized_end=1005
|
|
62
|
+
_globals['_EVENT']._serialized_start=1007
|
|
63
|
+
_globals['_EVENT']._serialized_end=1088
|
|
64
|
+
_globals['_MEMORYPOOL']._serialized_start=1091
|
|
65
|
+
_globals['_MEMORYPOOL']._serialized_end=1712
|
|
66
|
+
# @@protoc_insertion_point(module_scope)
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
from google.protobuf import descriptor as _descriptor
|
|
2
|
+
from google.protobuf import message as _message
|
|
3
|
+
from collections.abc import Mapping as _Mapping
|
|
4
|
+
from typing import ClassVar as _ClassVar, Optional as _Optional, Union as _Union
|
|
5
|
+
|
|
6
|
+
DESCRIPTOR: _descriptor.FileDescriptor
|
|
7
|
+
|
|
8
|
+
class SessionRequest(_message.Message):
|
|
9
|
+
__slots__ = ()
|
|
10
|
+
def __init__(self) -> None: ...
|
|
11
|
+
|
|
12
|
+
class SessionResponse(_message.Message):
|
|
13
|
+
__slots__ = ("session", "event")
|
|
14
|
+
SESSION_FIELD_NUMBER: _ClassVar[int]
|
|
15
|
+
EVENT_FIELD_NUMBER: _ClassVar[int]
|
|
16
|
+
session: Session
|
|
17
|
+
event: Event
|
|
18
|
+
def __init__(self, session: _Optional[_Union[Session, _Mapping]] = ..., event: _Optional[_Union[Event, _Mapping]] = ...) -> None: ...
|
|
19
|
+
|
|
20
|
+
class AcquireRequest(_message.Message):
|
|
21
|
+
__slots__ = ("reference", "session")
|
|
22
|
+
REFERENCE_FIELD_NUMBER: _ClassVar[int]
|
|
23
|
+
SESSION_FIELD_NUMBER: _ClassVar[int]
|
|
24
|
+
reference: Reference
|
|
25
|
+
session: Session
|
|
26
|
+
def __init__(self, reference: _Optional[_Union[Reference, _Mapping]] = ..., session: _Optional[_Union[Session, _Mapping]] = ...) -> None: ...
|
|
27
|
+
|
|
28
|
+
class AcquireResponse(_message.Message):
|
|
29
|
+
__slots__ = ()
|
|
30
|
+
def __init__(self) -> None: ...
|
|
31
|
+
|
|
32
|
+
class PutRequest(_message.Message):
|
|
33
|
+
__slots__ = ("session", "mutable", "dump")
|
|
34
|
+
SESSION_FIELD_NUMBER: _ClassVar[int]
|
|
35
|
+
MUTABLE_FIELD_NUMBER: _ClassVar[int]
|
|
36
|
+
DUMP_FIELD_NUMBER: _ClassVar[int]
|
|
37
|
+
session: Session
|
|
38
|
+
mutable: bool
|
|
39
|
+
dump: bytes
|
|
40
|
+
def __init__(self, session: _Optional[_Union[Session, _Mapping]] = ..., mutable: bool = ..., dump: _Optional[bytes] = ...) -> None: ...
|
|
41
|
+
|
|
42
|
+
class PutResponse(_message.Message):
|
|
43
|
+
__slots__ = ("reference",)
|
|
44
|
+
REFERENCE_FIELD_NUMBER: _ClassVar[int]
|
|
45
|
+
reference: Reference
|
|
46
|
+
def __init__(self, reference: _Optional[_Union[Reference, _Mapping]] = ...) -> None: ...
|
|
47
|
+
|
|
48
|
+
class PostRequest(_message.Message):
|
|
49
|
+
__slots__ = ("session", "reference", "dump")
|
|
50
|
+
SESSION_FIELD_NUMBER: _ClassVar[int]
|
|
51
|
+
REFERENCE_FIELD_NUMBER: _ClassVar[int]
|
|
52
|
+
DUMP_FIELD_NUMBER: _ClassVar[int]
|
|
53
|
+
session: Session
|
|
54
|
+
reference: Reference
|
|
55
|
+
dump: bytes
|
|
56
|
+
def __init__(self, session: _Optional[_Union[Session, _Mapping]] = ..., reference: _Optional[_Union[Reference, _Mapping]] = ..., dump: _Optional[bytes] = ...) -> None: ...
|
|
57
|
+
|
|
58
|
+
class PostResponse(_message.Message):
|
|
59
|
+
__slots__ = ("updated",)
|
|
60
|
+
UPDATED_FIELD_NUMBER: _ClassVar[int]
|
|
61
|
+
updated: bool
|
|
62
|
+
def __init__(self, updated: bool = ...) -> None: ...
|
|
63
|
+
|
|
64
|
+
class GetRequest(_message.Message):
|
|
65
|
+
__slots__ = ("reference", "session")
|
|
66
|
+
REFERENCE_FIELD_NUMBER: _ClassVar[int]
|
|
67
|
+
SESSION_FIELD_NUMBER: _ClassVar[int]
|
|
68
|
+
reference: Reference
|
|
69
|
+
session: Session
|
|
70
|
+
def __init__(self, reference: _Optional[_Union[Reference, _Mapping]] = ..., session: _Optional[_Union[Session, _Mapping]] = ...) -> None: ...
|
|
71
|
+
|
|
72
|
+
class GetResponse(_message.Message):
|
|
73
|
+
__slots__ = ("dump",)
|
|
74
|
+
DUMP_FIELD_NUMBER: _ClassVar[int]
|
|
75
|
+
dump: bytes
|
|
76
|
+
def __init__(self, dump: _Optional[bytes] = ...) -> None: ...
|
|
77
|
+
|
|
78
|
+
class ReleaseRequest(_message.Message):
|
|
79
|
+
__slots__ = ("reference", "session")
|
|
80
|
+
REFERENCE_FIELD_NUMBER: _ClassVar[int]
|
|
81
|
+
SESSION_FIELD_NUMBER: _ClassVar[int]
|
|
82
|
+
reference: Reference
|
|
83
|
+
session: Session
|
|
84
|
+
def __init__(self, reference: _Optional[_Union[Reference, _Mapping]] = ..., session: _Optional[_Union[Session, _Mapping]] = ...) -> None: ...
|
|
85
|
+
|
|
86
|
+
class ReleaseResponse(_message.Message):
|
|
87
|
+
__slots__ = ()
|
|
88
|
+
def __init__(self) -> None: ...
|
|
89
|
+
|
|
90
|
+
class Reference(_message.Message):
|
|
91
|
+
__slots__ = ("id",)
|
|
92
|
+
ID_FIELD_NUMBER: _ClassVar[int]
|
|
93
|
+
id: str
|
|
94
|
+
def __init__(self, id: _Optional[str] = ...) -> None: ...
|
|
95
|
+
|
|
96
|
+
class Session(_message.Message):
|
|
97
|
+
__slots__ = ("id",)
|
|
98
|
+
ID_FIELD_NUMBER: _ClassVar[int]
|
|
99
|
+
id: str
|
|
100
|
+
def __init__(self, id: _Optional[str] = ...) -> None: ...
|
|
101
|
+
|
|
102
|
+
class Event(_message.Message):
|
|
103
|
+
__slots__ = ("reference", "event_type")
|
|
104
|
+
REFERENCE_FIELD_NUMBER: _ClassVar[int]
|
|
105
|
+
EVENT_TYPE_FIELD_NUMBER: _ClassVar[int]
|
|
106
|
+
reference: Reference
|
|
107
|
+
event_type: str
|
|
108
|
+
def __init__(self, reference: _Optional[_Union[Reference, _Mapping]] = ..., event_type: _Optional[str] = ...) -> None: ...
|