wool 0.1rc6__py3-none-any.whl → 0.1rc8__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/__init__.py +37 -27
- wool/_cli.py +79 -38
- wool/_event.py +109 -0
- wool/_future.py +82 -11
- wool/_logging.py +7 -0
- wool/_manager.py +36 -20
- wool/_mempool/__init__.py +4 -0
- wool/_mempool/_mempool.py +311 -0
- wool/_mempool/_metadata.py +39 -0
- wool/_mempool/_service.py +225 -0
- wool/_pool.py +357 -149
- wool/_protobuf/__init__.py +4 -0
- wool/_protobuf/mempool/mempool_pb2.py +66 -0
- wool/_protobuf/mempool/mempool_pb2.pyi +108 -0
- wool/_protobuf/mempool/mempool_pb2_grpc.py +312 -0
- wool/_protobuf/mempool/metadata/metadata_pb2.py +36 -0
- wool/_protobuf/mempool/metadata/metadata_pb2.pyi +17 -0
- wool/_protobuf/mempool/metadata/metadata_pb2_grpc.py +24 -0
- wool/_queue.py +2 -1
- wool/_session.py +429 -0
- wool/_task.py +169 -113
- wool/_typing.py +5 -1
- wool/_utils.py +10 -17
- wool/_worker.py +120 -73
- wool-0.1rc8.dist-info/METADATA +348 -0
- wool-0.1rc8.dist-info/RECORD +28 -0
- {wool-0.1rc6.dist-info → wool-0.1rc8.dist-info}/WHEEL +1 -2
- wool/_client.py +0 -205
- wool-0.1rc6.dist-info/METADATA +0 -138
- wool-0.1rc6.dist-info/RECORD +0 -17
- wool-0.1rc6.dist-info/top_level.txt +0 -1
- {wool-0.1rc6.dist-info → wool-0.1rc8.dist-info}/entry_points.txt +0 -0
|
@@ -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/mempool.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/mempool.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/mempool.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\x95\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\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.mempool_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=1624
|
|
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: ...
|
|
@@ -0,0 +1,312 @@
|
|
|
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
|
+
from mempool import mempool_pb2 as mempool_dot_mempool__pb2
|
|
7
|
+
|
|
8
|
+
GRPC_GENERATED_VERSION = '1.73.1'
|
|
9
|
+
GRPC_VERSION = grpc.__version__
|
|
10
|
+
_version_not_supported = False
|
|
11
|
+
|
|
12
|
+
try:
|
|
13
|
+
from grpc._utilities import first_version_is_lower
|
|
14
|
+
_version_not_supported = first_version_is_lower(GRPC_VERSION, GRPC_GENERATED_VERSION)
|
|
15
|
+
except ImportError:
|
|
16
|
+
_version_not_supported = True
|
|
17
|
+
|
|
18
|
+
if _version_not_supported:
|
|
19
|
+
raise RuntimeError(
|
|
20
|
+
f'The grpc package installed is at version {GRPC_VERSION},'
|
|
21
|
+
+ f' but the generated code in mempool/mempool_pb2_grpc.py depends on'
|
|
22
|
+
+ f' grpcio>={GRPC_GENERATED_VERSION}.'
|
|
23
|
+
+ f' Please upgrade your grpc module to grpcio>={GRPC_GENERATED_VERSION}'
|
|
24
|
+
+ f' or downgrade your generated code using grpcio-tools<={GRPC_VERSION}.'
|
|
25
|
+
)
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
class MemoryPoolStub(object):
|
|
29
|
+
"""Missing associated documentation comment in .proto file."""
|
|
30
|
+
|
|
31
|
+
def __init__(self, channel):
|
|
32
|
+
"""Constructor.
|
|
33
|
+
|
|
34
|
+
Args:
|
|
35
|
+
channel: A grpc.Channel.
|
|
36
|
+
"""
|
|
37
|
+
self.session = channel.unary_stream(
|
|
38
|
+
'/wool._protobuf.mempool.MemoryPool/session',
|
|
39
|
+
request_serializer=mempool_dot_mempool__pb2.SessionRequest.SerializeToString,
|
|
40
|
+
response_deserializer=mempool_dot_mempool__pb2.SessionResponse.FromString,
|
|
41
|
+
_registered_method=True)
|
|
42
|
+
self.acquire = channel.unary_unary(
|
|
43
|
+
'/wool._protobuf.mempool.MemoryPool/acquire',
|
|
44
|
+
request_serializer=mempool_dot_mempool__pb2.AcquireRequest.SerializeToString,
|
|
45
|
+
response_deserializer=mempool_dot_mempool__pb2.AcquireResponse.FromString,
|
|
46
|
+
_registered_method=True)
|
|
47
|
+
self.put = channel.unary_unary(
|
|
48
|
+
'/wool._protobuf.mempool.MemoryPool/put',
|
|
49
|
+
request_serializer=mempool_dot_mempool__pb2.PutRequest.SerializeToString,
|
|
50
|
+
response_deserializer=mempool_dot_mempool__pb2.PutResponse.FromString,
|
|
51
|
+
_registered_method=True)
|
|
52
|
+
self.post = channel.unary_unary(
|
|
53
|
+
'/wool._protobuf.mempool.MemoryPool/post',
|
|
54
|
+
request_serializer=mempool_dot_mempool__pb2.PostRequest.SerializeToString,
|
|
55
|
+
response_deserializer=mempool_dot_mempool__pb2.PostResponse.FromString,
|
|
56
|
+
_registered_method=True)
|
|
57
|
+
self.get = channel.unary_unary(
|
|
58
|
+
'/wool._protobuf.mempool.MemoryPool/get',
|
|
59
|
+
request_serializer=mempool_dot_mempool__pb2.GetRequest.SerializeToString,
|
|
60
|
+
response_deserializer=mempool_dot_mempool__pb2.GetResponse.FromString,
|
|
61
|
+
_registered_method=True)
|
|
62
|
+
self.release = channel.unary_unary(
|
|
63
|
+
'/wool._protobuf.mempool.MemoryPool/release',
|
|
64
|
+
request_serializer=mempool_dot_mempool__pb2.ReleaseRequest.SerializeToString,
|
|
65
|
+
response_deserializer=mempool_dot_mempool__pb2.ReleaseResponse.FromString,
|
|
66
|
+
_registered_method=True)
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
class MemoryPoolServicer(object):
|
|
70
|
+
"""Missing associated documentation comment in .proto file."""
|
|
71
|
+
|
|
72
|
+
def session(self, request, context):
|
|
73
|
+
"""Missing associated documentation comment in .proto file."""
|
|
74
|
+
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
|
|
75
|
+
context.set_details('Method not implemented!')
|
|
76
|
+
raise NotImplementedError('Method not implemented!')
|
|
77
|
+
|
|
78
|
+
def acquire(self, request, context):
|
|
79
|
+
"""Missing associated documentation comment in .proto file."""
|
|
80
|
+
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
|
|
81
|
+
context.set_details('Method not implemented!')
|
|
82
|
+
raise NotImplementedError('Method not implemented!')
|
|
83
|
+
|
|
84
|
+
def put(self, request, context):
|
|
85
|
+
"""Missing associated documentation comment in .proto file."""
|
|
86
|
+
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
|
|
87
|
+
context.set_details('Method not implemented!')
|
|
88
|
+
raise NotImplementedError('Method not implemented!')
|
|
89
|
+
|
|
90
|
+
def post(self, request, context):
|
|
91
|
+
"""Missing associated documentation comment in .proto file."""
|
|
92
|
+
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
|
|
93
|
+
context.set_details('Method not implemented!')
|
|
94
|
+
raise NotImplementedError('Method not implemented!')
|
|
95
|
+
|
|
96
|
+
def get(self, request, context):
|
|
97
|
+
"""Missing associated documentation comment in .proto file."""
|
|
98
|
+
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
|
|
99
|
+
context.set_details('Method not implemented!')
|
|
100
|
+
raise NotImplementedError('Method not implemented!')
|
|
101
|
+
|
|
102
|
+
def release(self, request, context):
|
|
103
|
+
"""Missing associated documentation comment in .proto file."""
|
|
104
|
+
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
|
|
105
|
+
context.set_details('Method not implemented!')
|
|
106
|
+
raise NotImplementedError('Method not implemented!')
|
|
107
|
+
|
|
108
|
+
|
|
109
|
+
def add_MemoryPoolServicer_to_server(servicer, server):
|
|
110
|
+
rpc_method_handlers = {
|
|
111
|
+
'session': grpc.unary_stream_rpc_method_handler(
|
|
112
|
+
servicer.session,
|
|
113
|
+
request_deserializer=mempool_dot_mempool__pb2.SessionRequest.FromString,
|
|
114
|
+
response_serializer=mempool_dot_mempool__pb2.SessionResponse.SerializeToString,
|
|
115
|
+
),
|
|
116
|
+
'acquire': grpc.unary_unary_rpc_method_handler(
|
|
117
|
+
servicer.acquire,
|
|
118
|
+
request_deserializer=mempool_dot_mempool__pb2.AcquireRequest.FromString,
|
|
119
|
+
response_serializer=mempool_dot_mempool__pb2.AcquireResponse.SerializeToString,
|
|
120
|
+
),
|
|
121
|
+
'put': grpc.unary_unary_rpc_method_handler(
|
|
122
|
+
servicer.put,
|
|
123
|
+
request_deserializer=mempool_dot_mempool__pb2.PutRequest.FromString,
|
|
124
|
+
response_serializer=mempool_dot_mempool__pb2.PutResponse.SerializeToString,
|
|
125
|
+
),
|
|
126
|
+
'post': grpc.unary_unary_rpc_method_handler(
|
|
127
|
+
servicer.post,
|
|
128
|
+
request_deserializer=mempool_dot_mempool__pb2.PostRequest.FromString,
|
|
129
|
+
response_serializer=mempool_dot_mempool__pb2.PostResponse.SerializeToString,
|
|
130
|
+
),
|
|
131
|
+
'get': grpc.unary_unary_rpc_method_handler(
|
|
132
|
+
servicer.get,
|
|
133
|
+
request_deserializer=mempool_dot_mempool__pb2.GetRequest.FromString,
|
|
134
|
+
response_serializer=mempool_dot_mempool__pb2.GetResponse.SerializeToString,
|
|
135
|
+
),
|
|
136
|
+
'release': grpc.unary_unary_rpc_method_handler(
|
|
137
|
+
servicer.release,
|
|
138
|
+
request_deserializer=mempool_dot_mempool__pb2.ReleaseRequest.FromString,
|
|
139
|
+
response_serializer=mempool_dot_mempool__pb2.ReleaseResponse.SerializeToString,
|
|
140
|
+
),
|
|
141
|
+
}
|
|
142
|
+
generic_handler = grpc.method_handlers_generic_handler(
|
|
143
|
+
'wool._protobuf.mempool.MemoryPool', rpc_method_handlers)
|
|
144
|
+
server.add_generic_rpc_handlers((generic_handler,))
|
|
145
|
+
server.add_registered_method_handlers('wool._protobuf.mempool.MemoryPool', rpc_method_handlers)
|
|
146
|
+
|
|
147
|
+
|
|
148
|
+
# This class is part of an EXPERIMENTAL API.
|
|
149
|
+
class MemoryPool(object):
|
|
150
|
+
"""Missing associated documentation comment in .proto file."""
|
|
151
|
+
|
|
152
|
+
@staticmethod
|
|
153
|
+
def session(request,
|
|
154
|
+
target,
|
|
155
|
+
options=(),
|
|
156
|
+
channel_credentials=None,
|
|
157
|
+
call_credentials=None,
|
|
158
|
+
insecure=False,
|
|
159
|
+
compression=None,
|
|
160
|
+
wait_for_ready=None,
|
|
161
|
+
timeout=None,
|
|
162
|
+
metadata=None):
|
|
163
|
+
return grpc.experimental.unary_stream(
|
|
164
|
+
request,
|
|
165
|
+
target,
|
|
166
|
+
'/wool._protobuf.mempool.MemoryPool/session',
|
|
167
|
+
mempool_dot_mempool__pb2.SessionRequest.SerializeToString,
|
|
168
|
+
mempool_dot_mempool__pb2.SessionResponse.FromString,
|
|
169
|
+
options,
|
|
170
|
+
channel_credentials,
|
|
171
|
+
insecure,
|
|
172
|
+
call_credentials,
|
|
173
|
+
compression,
|
|
174
|
+
wait_for_ready,
|
|
175
|
+
timeout,
|
|
176
|
+
metadata,
|
|
177
|
+
_registered_method=True)
|
|
178
|
+
|
|
179
|
+
@staticmethod
|
|
180
|
+
def acquire(request,
|
|
181
|
+
target,
|
|
182
|
+
options=(),
|
|
183
|
+
channel_credentials=None,
|
|
184
|
+
call_credentials=None,
|
|
185
|
+
insecure=False,
|
|
186
|
+
compression=None,
|
|
187
|
+
wait_for_ready=None,
|
|
188
|
+
timeout=None,
|
|
189
|
+
metadata=None):
|
|
190
|
+
return grpc.experimental.unary_unary(
|
|
191
|
+
request,
|
|
192
|
+
target,
|
|
193
|
+
'/wool._protobuf.mempool.MemoryPool/acquire',
|
|
194
|
+
mempool_dot_mempool__pb2.AcquireRequest.SerializeToString,
|
|
195
|
+
mempool_dot_mempool__pb2.AcquireResponse.FromString,
|
|
196
|
+
options,
|
|
197
|
+
channel_credentials,
|
|
198
|
+
insecure,
|
|
199
|
+
call_credentials,
|
|
200
|
+
compression,
|
|
201
|
+
wait_for_ready,
|
|
202
|
+
timeout,
|
|
203
|
+
metadata,
|
|
204
|
+
_registered_method=True)
|
|
205
|
+
|
|
206
|
+
@staticmethod
|
|
207
|
+
def put(request,
|
|
208
|
+
target,
|
|
209
|
+
options=(),
|
|
210
|
+
channel_credentials=None,
|
|
211
|
+
call_credentials=None,
|
|
212
|
+
insecure=False,
|
|
213
|
+
compression=None,
|
|
214
|
+
wait_for_ready=None,
|
|
215
|
+
timeout=None,
|
|
216
|
+
metadata=None):
|
|
217
|
+
return grpc.experimental.unary_unary(
|
|
218
|
+
request,
|
|
219
|
+
target,
|
|
220
|
+
'/wool._protobuf.mempool.MemoryPool/put',
|
|
221
|
+
mempool_dot_mempool__pb2.PutRequest.SerializeToString,
|
|
222
|
+
mempool_dot_mempool__pb2.PutResponse.FromString,
|
|
223
|
+
options,
|
|
224
|
+
channel_credentials,
|
|
225
|
+
insecure,
|
|
226
|
+
call_credentials,
|
|
227
|
+
compression,
|
|
228
|
+
wait_for_ready,
|
|
229
|
+
timeout,
|
|
230
|
+
metadata,
|
|
231
|
+
_registered_method=True)
|
|
232
|
+
|
|
233
|
+
@staticmethod
|
|
234
|
+
def post(request,
|
|
235
|
+
target,
|
|
236
|
+
options=(),
|
|
237
|
+
channel_credentials=None,
|
|
238
|
+
call_credentials=None,
|
|
239
|
+
insecure=False,
|
|
240
|
+
compression=None,
|
|
241
|
+
wait_for_ready=None,
|
|
242
|
+
timeout=None,
|
|
243
|
+
metadata=None):
|
|
244
|
+
return grpc.experimental.unary_unary(
|
|
245
|
+
request,
|
|
246
|
+
target,
|
|
247
|
+
'/wool._protobuf.mempool.MemoryPool/post',
|
|
248
|
+
mempool_dot_mempool__pb2.PostRequest.SerializeToString,
|
|
249
|
+
mempool_dot_mempool__pb2.PostResponse.FromString,
|
|
250
|
+
options,
|
|
251
|
+
channel_credentials,
|
|
252
|
+
insecure,
|
|
253
|
+
call_credentials,
|
|
254
|
+
compression,
|
|
255
|
+
wait_for_ready,
|
|
256
|
+
timeout,
|
|
257
|
+
metadata,
|
|
258
|
+
_registered_method=True)
|
|
259
|
+
|
|
260
|
+
@staticmethod
|
|
261
|
+
def get(request,
|
|
262
|
+
target,
|
|
263
|
+
options=(),
|
|
264
|
+
channel_credentials=None,
|
|
265
|
+
call_credentials=None,
|
|
266
|
+
insecure=False,
|
|
267
|
+
compression=None,
|
|
268
|
+
wait_for_ready=None,
|
|
269
|
+
timeout=None,
|
|
270
|
+
metadata=None):
|
|
271
|
+
return grpc.experimental.unary_unary(
|
|
272
|
+
request,
|
|
273
|
+
target,
|
|
274
|
+
'/wool._protobuf.mempool.MemoryPool/get',
|
|
275
|
+
mempool_dot_mempool__pb2.GetRequest.SerializeToString,
|
|
276
|
+
mempool_dot_mempool__pb2.GetResponse.FromString,
|
|
277
|
+
options,
|
|
278
|
+
channel_credentials,
|
|
279
|
+
insecure,
|
|
280
|
+
call_credentials,
|
|
281
|
+
compression,
|
|
282
|
+
wait_for_ready,
|
|
283
|
+
timeout,
|
|
284
|
+
metadata,
|
|
285
|
+
_registered_method=True)
|
|
286
|
+
|
|
287
|
+
@staticmethod
|
|
288
|
+
def release(request,
|
|
289
|
+
target,
|
|
290
|
+
options=(),
|
|
291
|
+
channel_credentials=None,
|
|
292
|
+
call_credentials=None,
|
|
293
|
+
insecure=False,
|
|
294
|
+
compression=None,
|
|
295
|
+
wait_for_ready=None,
|
|
296
|
+
timeout=None,
|
|
297
|
+
metadata=None):
|
|
298
|
+
return grpc.experimental.unary_unary(
|
|
299
|
+
request,
|
|
300
|
+
target,
|
|
301
|
+
'/wool._protobuf.mempool.MemoryPool/release',
|
|
302
|
+
mempool_dot_mempool__pb2.ReleaseRequest.SerializeToString,
|
|
303
|
+
mempool_dot_mempool__pb2.ReleaseResponse.FromString,
|
|
304
|
+
options,
|
|
305
|
+
channel_credentials,
|
|
306
|
+
insecure,
|
|
307
|
+
call_credentials,
|
|
308
|
+
compression,
|
|
309
|
+
wait_for_ready,
|
|
310
|
+
timeout,
|
|
311
|
+
metadata,
|
|
312
|
+
_registered_method=True)
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
# -*- coding: utf-8 -*-
|
|
2
|
+
# Generated by the protocol buffer compiler. DO NOT EDIT!
|
|
3
|
+
# NO CHECKED-IN PROTOBUF GENCODE
|
|
4
|
+
# source: mempool/metadata/metadata.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/metadata/metadata.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\x1fmempool/metadata/metadata.proto\x12\x16wool._mempool.metadata\"K\n\x10_MetadataMessage\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
|
+
|
|
29
|
+
_globals = globals()
|
|
30
|
+
_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals)
|
|
31
|
+
_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'mempool.metadata.metadata_pb2', _globals)
|
|
32
|
+
if not _descriptor._USE_C_DESCRIPTORS:
|
|
33
|
+
DESCRIPTOR._loaded_options = None
|
|
34
|
+
_globals['__METADATAMESSAGE']._serialized_start=59
|
|
35
|
+
_globals['__METADATAMESSAGE']._serialized_end=134
|
|
36
|
+
# @@protoc_insertion_point(module_scope)
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
from google.protobuf import descriptor as _descriptor
|
|
2
|
+
from google.protobuf import message as _message
|
|
3
|
+
from typing import ClassVar as _ClassVar, Optional as _Optional
|
|
4
|
+
|
|
5
|
+
DESCRIPTOR: _descriptor.FileDescriptor
|
|
6
|
+
|
|
7
|
+
class _MetadataMessage(_message.Message):
|
|
8
|
+
__slots__ = ("ref", "mutable", "size", "md5")
|
|
9
|
+
REF_FIELD_NUMBER: _ClassVar[int]
|
|
10
|
+
MUTABLE_FIELD_NUMBER: _ClassVar[int]
|
|
11
|
+
SIZE_FIELD_NUMBER: _ClassVar[int]
|
|
12
|
+
MD5_FIELD_NUMBER: _ClassVar[int]
|
|
13
|
+
ref: str
|
|
14
|
+
mutable: bool
|
|
15
|
+
size: int
|
|
16
|
+
md5: bytes
|
|
17
|
+
def __init__(self, ref: _Optional[str] = ..., mutable: bool = ..., size: _Optional[int] = ..., md5: _Optional[bytes] = ...) -> None: ...
|
|
@@ -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/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
|
+
)
|