diff --git a/fila/fibp.py b/fila/fibp.py index 99a4091..fe834bf 100644 --- a/fila/fibp.py +++ b/fila/fibp.py @@ -19,7 +19,7 @@ Hot path (binary body): 0x01 ENQUEUE, 0x02 CONSUME, 0x03 ACK, 0x04 NACK -Admin (protobuf body): +Admin (binary body): 0x10 CREATE_QUEUE, 0x11 DELETE_QUEUE, 0x12 QUEUE_STATS, 0x13 LIST_QUEUES, 0x14 REDRIVE, 0x15 CONFIG_SET, 0x16 CONFIG_GET, 0x17 CONFIG_LIST @@ -186,11 +186,6 @@ def encode_auth(corr_id: int, api_key: str) -> bytes: return _encode_frame(0, OP_AUTH, corr_id, api_key.encode()) -def encode_admin(op: int, corr_id: int, proto_body: bytes) -> bytes: - """Encode an admin frame with a protobuf-serialised body.""" - return _encode_frame(0, op, corr_id, proto_body) - - # ------------------------------------------------------------------ # Decoding helpers # ------------------------------------------------------------------ diff --git a/fila/v1/__init__.py b/fila/v1/__init__.py deleted file mode 100644 index e69de29..0000000 diff --git a/fila/v1/admin_pb2.py b/fila/v1/admin_pb2.py deleted file mode 100644 index 7dc1f25..0000000 --- a/fila/v1/admin_pb2.py +++ /dev/null @@ -1,78 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by the protocol buffer compiler. DO NOT EDIT! -# NO CHECKED-IN PROTOBUF GENCODE -# source: fila/v1/admin.proto -# Protobuf Python Version: 6.31.1 -"""Generated protocol buffer code.""" -from google.protobuf import descriptor as _descriptor -from google.protobuf import descriptor_pool as _descriptor_pool -from google.protobuf import runtime_version as _runtime_version -from google.protobuf import symbol_database as _symbol_database -from google.protobuf.internal import builder as _builder -_runtime_version.ValidateProtobufRuntimeVersion( - _runtime_version.Domain.PUBLIC, - 6, - 31, - 1, - '', - 'fila/v1/admin.proto' -) -# @@protoc_insertion_point(imports) - -_sym_db = _symbol_database.Default() - - - - -DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x13\x66ila/v1/admin.proto\x12\x07\x66ila.v1\"H\n\x12\x43reateQueueRequest\x12\x0c\n\x04name\x18\x01 \x01(\t\x12$\n\x06\x63onfig\x18\x02 \x01(\x0b\x32\x14.fila.v1.QueueConfig\"b\n\x0bQueueConfig\x12\x19\n\x11on_enqueue_script\x18\x01 \x01(\t\x12\x19\n\x11on_failure_script\x18\x02 \x01(\t\x12\x1d\n\x15visibility_timeout_ms\x18\x03 \x01(\x04\"\'\n\x13\x43reateQueueResponse\x12\x10\n\x08queue_id\x18\x01 \x01(\t\"#\n\x12\x44\x65leteQueueRequest\x12\r\n\x05queue\x18\x01 \x01(\t\"\x15\n\x13\x44\x65leteQueueResponse\".\n\x10SetConfigRequest\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t\"\x13\n\x11SetConfigResponse\"\x1f\n\x10GetConfigRequest\x12\x0b\n\x03key\x18\x01 \x01(\t\"\"\n\x11GetConfigResponse\x12\r\n\x05value\x18\x01 \x01(\t\")\n\x0b\x43onfigEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t\"#\n\x11ListConfigRequest\x12\x0e\n\x06prefix\x18\x01 \x01(\t\"P\n\x12ListConfigResponse\x12%\n\x07\x65ntries\x18\x01 \x03(\x0b\x32\x14.fila.v1.ConfigEntry\x12\x13\n\x0btotal_count\x18\x02 \x01(\r\" \n\x0fGetStatsRequest\x12\r\n\x05queue\x18\x01 \x01(\t\"b\n\x13PerFairnessKeyStats\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\x15\n\rpending_count\x18\x02 \x01(\x04\x12\x17\n\x0f\x63urrent_deficit\x18\x03 \x01(\x03\x12\x0e\n\x06weight\x18\x04 \x01(\r\"Z\n\x13PerThrottleKeyStats\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\x0e\n\x06tokens\x18\x02 \x01(\x01\x12\x17\n\x0frate_per_second\x18\x03 \x01(\x01\x12\r\n\x05\x62urst\x18\x04 \x01(\x01\"\x9f\x02\n\x10GetStatsResponse\x12\r\n\x05\x64\x65pth\x18\x01 \x01(\x04\x12\x11\n\tin_flight\x18\x02 \x01(\x04\x12\x1c\n\x14\x61\x63tive_fairness_keys\x18\x03 \x01(\x04\x12\x18\n\x10\x61\x63tive_consumers\x18\x04 \x01(\r\x12\x0f\n\x07quantum\x18\x05 \x01(\r\x12\x33\n\rper_key_stats\x18\x06 \x03(\x0b\x32\x1c.fila.v1.PerFairnessKeyStats\x12\x38\n\x12per_throttle_stats\x18\x07 \x03(\x0b\x32\x1c.fila.v1.PerThrottleKeyStats\x12\x16\n\x0eleader_node_id\x18\x08 \x01(\x04\x12\x19\n\x11replication_count\x18\t \x01(\r\"2\n\x0eRedriveRequest\x12\x11\n\tdlq_queue\x18\x01 \x01(\t\x12\r\n\x05\x63ount\x18\x02 \x01(\x04\"#\n\x0fRedriveResponse\x12\x10\n\x08redriven\x18\x01 \x01(\x04\"\x13\n\x11ListQueuesRequest\"m\n\tQueueInfo\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\r\n\x05\x64\x65pth\x18\x02 \x01(\x04\x12\x11\n\tin_flight\x18\x03 \x01(\x04\x12\x18\n\x10\x61\x63tive_consumers\x18\x04 \x01(\r\x12\x16\n\x0eleader_node_id\x18\x05 \x01(\x04\"T\n\x12ListQueuesResponse\x12\"\n\x06queues\x18\x01 \x03(\x0b\x32\x12.fila.v1.QueueInfo\x12\x1a\n\x12\x63luster_node_count\x18\x02 \x01(\r2\xb4\x04\n\tFilaAdmin\x12H\n\x0b\x43reateQueue\x12\x1b.fila.v1.CreateQueueRequest\x1a\x1c.fila.v1.CreateQueueResponse\x12H\n\x0b\x44\x65leteQueue\x12\x1b.fila.v1.DeleteQueueRequest\x1a\x1c.fila.v1.DeleteQueueResponse\x12\x42\n\tSetConfig\x12\x19.fila.v1.SetConfigRequest\x1a\x1a.fila.v1.SetConfigResponse\x12\x42\n\tGetConfig\x12\x19.fila.v1.GetConfigRequest\x1a\x1a.fila.v1.GetConfigResponse\x12\x45\n\nListConfig\x12\x1a.fila.v1.ListConfigRequest\x1a\x1b.fila.v1.ListConfigResponse\x12?\n\x08GetStats\x12\x18.fila.v1.GetStatsRequest\x1a\x19.fila.v1.GetStatsResponse\x12<\n\x07Redrive\x12\x17.fila.v1.RedriveRequest\x1a\x18.fila.v1.RedriveResponse\x12\x45\n\nListQueues\x12\x1a.fila.v1.ListQueuesRequest\x1a\x1b.fila.v1.ListQueuesResponseb\x06proto3') - -_globals = globals() -_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) -_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'fila.v1.admin_pb2', _globals) -if not _descriptor._USE_C_DESCRIPTORS: - DESCRIPTOR._loaded_options = None - _globals['_CREATEQUEUEREQUEST']._serialized_start=32 - _globals['_CREATEQUEUEREQUEST']._serialized_end=104 - _globals['_QUEUECONFIG']._serialized_start=106 - _globals['_QUEUECONFIG']._serialized_end=204 - _globals['_CREATEQUEUERESPONSE']._serialized_start=206 - _globals['_CREATEQUEUERESPONSE']._serialized_end=245 - _globals['_DELETEQUEUEREQUEST']._serialized_start=247 - _globals['_DELETEQUEUEREQUEST']._serialized_end=282 - _globals['_DELETEQUEUERESPONSE']._serialized_start=284 - _globals['_DELETEQUEUERESPONSE']._serialized_end=305 - _globals['_SETCONFIGREQUEST']._serialized_start=307 - _globals['_SETCONFIGREQUEST']._serialized_end=353 - _globals['_SETCONFIGRESPONSE']._serialized_start=355 - _globals['_SETCONFIGRESPONSE']._serialized_end=374 - _globals['_GETCONFIGREQUEST']._serialized_start=376 - _globals['_GETCONFIGREQUEST']._serialized_end=407 - _globals['_GETCONFIGRESPONSE']._serialized_start=409 - _globals['_GETCONFIGRESPONSE']._serialized_end=443 - _globals['_CONFIGENTRY']._serialized_start=445 - _globals['_CONFIGENTRY']._serialized_end=486 - _globals['_LISTCONFIGREQUEST']._serialized_start=488 - _globals['_LISTCONFIGREQUEST']._serialized_end=523 - _globals['_LISTCONFIGRESPONSE']._serialized_start=525 - _globals['_LISTCONFIGRESPONSE']._serialized_end=605 - _globals['_GETSTATSREQUEST']._serialized_start=607 - _globals['_GETSTATSREQUEST']._serialized_end=639 - _globals['_PERFAIRNESSKEYSTATS']._serialized_start=641 - _globals['_PERFAIRNESSKEYSTATS']._serialized_end=739 - _globals['_PERTHROTTLEKEYSTATS']._serialized_start=741 - _globals['_PERTHROTTLEKEYSTATS']._serialized_end=831 - _globals['_GETSTATSRESPONSE']._serialized_start=834 - _globals['_GETSTATSRESPONSE']._serialized_end=1121 - _globals['_REDRIVEREQUEST']._serialized_start=1123 - _globals['_REDRIVEREQUEST']._serialized_end=1173 - _globals['_REDRIVERESPONSE']._serialized_start=1175 - _globals['_REDRIVERESPONSE']._serialized_end=1210 - _globals['_LISTQUEUESREQUEST']._serialized_start=1212 - _globals['_LISTQUEUESREQUEST']._serialized_end=1231 - _globals['_QUEUEINFO']._serialized_start=1233 - _globals['_QUEUEINFO']._serialized_end=1342 - _globals['_LISTQUEUESRESPONSE']._serialized_start=1344 - _globals['_LISTQUEUESRESPONSE']._serialized_end=1428 - _globals['_FILAADMIN']._serialized_start=1431 - _globals['_FILAADMIN']._serialized_end=1995 -# @@protoc_insertion_point(module_scope) diff --git a/fila/v1/admin_pb2.pyi b/fila/v1/admin_pb2.pyi deleted file mode 100644 index 0c594ce..0000000 --- a/fila/v1/admin_pb2.pyi +++ /dev/null @@ -1,179 +0,0 @@ -from google.protobuf.internal import containers as _containers -from google.protobuf import descriptor as _descriptor -from google.protobuf import message as _message -from collections.abc import Iterable as _Iterable, Mapping as _Mapping -from typing import ClassVar as _ClassVar, Optional as _Optional, Union as _Union - -DESCRIPTOR: _descriptor.FileDescriptor - -class CreateQueueRequest(_message.Message): - __slots__ = ("name", "config") - NAME_FIELD_NUMBER: _ClassVar[int] - CONFIG_FIELD_NUMBER: _ClassVar[int] - name: str - config: QueueConfig - def __init__(self, name: _Optional[str] = ..., config: _Optional[_Union[QueueConfig, _Mapping]] = ...) -> None: ... - -class QueueConfig(_message.Message): - __slots__ = ("on_enqueue_script", "on_failure_script", "visibility_timeout_ms") - ON_ENQUEUE_SCRIPT_FIELD_NUMBER: _ClassVar[int] - ON_FAILURE_SCRIPT_FIELD_NUMBER: _ClassVar[int] - VISIBILITY_TIMEOUT_MS_FIELD_NUMBER: _ClassVar[int] - on_enqueue_script: str - on_failure_script: str - visibility_timeout_ms: int - def __init__(self, on_enqueue_script: _Optional[str] = ..., on_failure_script: _Optional[str] = ..., visibility_timeout_ms: _Optional[int] = ...) -> None: ... - -class CreateQueueResponse(_message.Message): - __slots__ = ("queue_id",) - QUEUE_ID_FIELD_NUMBER: _ClassVar[int] - queue_id: str - def __init__(self, queue_id: _Optional[str] = ...) -> None: ... - -class DeleteQueueRequest(_message.Message): - __slots__ = ("queue",) - QUEUE_FIELD_NUMBER: _ClassVar[int] - queue: str - def __init__(self, queue: _Optional[str] = ...) -> None: ... - -class DeleteQueueResponse(_message.Message): - __slots__ = () - def __init__(self) -> None: ... - -class SetConfigRequest(_message.Message): - __slots__ = ("key", "value") - KEY_FIELD_NUMBER: _ClassVar[int] - VALUE_FIELD_NUMBER: _ClassVar[int] - key: str - value: str - def __init__(self, key: _Optional[str] = ..., value: _Optional[str] = ...) -> None: ... - -class SetConfigResponse(_message.Message): - __slots__ = () - def __init__(self) -> None: ... - -class GetConfigRequest(_message.Message): - __slots__ = ("key",) - KEY_FIELD_NUMBER: _ClassVar[int] - key: str - def __init__(self, key: _Optional[str] = ...) -> None: ... - -class GetConfigResponse(_message.Message): - __slots__ = ("value",) - VALUE_FIELD_NUMBER: _ClassVar[int] - value: str - def __init__(self, value: _Optional[str] = ...) -> None: ... - -class ConfigEntry(_message.Message): - __slots__ = ("key", "value") - KEY_FIELD_NUMBER: _ClassVar[int] - VALUE_FIELD_NUMBER: _ClassVar[int] - key: str - value: str - def __init__(self, key: _Optional[str] = ..., value: _Optional[str] = ...) -> None: ... - -class ListConfigRequest(_message.Message): - __slots__ = ("prefix",) - PREFIX_FIELD_NUMBER: _ClassVar[int] - prefix: str - def __init__(self, prefix: _Optional[str] = ...) -> None: ... - -class ListConfigResponse(_message.Message): - __slots__ = ("entries", "total_count") - ENTRIES_FIELD_NUMBER: _ClassVar[int] - TOTAL_COUNT_FIELD_NUMBER: _ClassVar[int] - entries: _containers.RepeatedCompositeFieldContainer[ConfigEntry] - total_count: int - def __init__(self, entries: _Optional[_Iterable[_Union[ConfigEntry, _Mapping]]] = ..., total_count: _Optional[int] = ...) -> None: ... - -class GetStatsRequest(_message.Message): - __slots__ = ("queue",) - QUEUE_FIELD_NUMBER: _ClassVar[int] - queue: str - def __init__(self, queue: _Optional[str] = ...) -> None: ... - -class PerFairnessKeyStats(_message.Message): - __slots__ = ("key", "pending_count", "current_deficit", "weight") - KEY_FIELD_NUMBER: _ClassVar[int] - PENDING_COUNT_FIELD_NUMBER: _ClassVar[int] - CURRENT_DEFICIT_FIELD_NUMBER: _ClassVar[int] - WEIGHT_FIELD_NUMBER: _ClassVar[int] - key: str - pending_count: int - current_deficit: int - weight: int - def __init__(self, key: _Optional[str] = ..., pending_count: _Optional[int] = ..., current_deficit: _Optional[int] = ..., weight: _Optional[int] = ...) -> None: ... - -class PerThrottleKeyStats(_message.Message): - __slots__ = ("key", "tokens", "rate_per_second", "burst") - KEY_FIELD_NUMBER: _ClassVar[int] - TOKENS_FIELD_NUMBER: _ClassVar[int] - RATE_PER_SECOND_FIELD_NUMBER: _ClassVar[int] - BURST_FIELD_NUMBER: _ClassVar[int] - key: str - tokens: float - rate_per_second: float - burst: float - def __init__(self, key: _Optional[str] = ..., tokens: _Optional[float] = ..., rate_per_second: _Optional[float] = ..., burst: _Optional[float] = ...) -> None: ... - -class GetStatsResponse(_message.Message): - __slots__ = ("depth", "in_flight", "active_fairness_keys", "active_consumers", "quantum", "per_key_stats", "per_throttle_stats", "leader_node_id", "replication_count") - DEPTH_FIELD_NUMBER: _ClassVar[int] - IN_FLIGHT_FIELD_NUMBER: _ClassVar[int] - ACTIVE_FAIRNESS_KEYS_FIELD_NUMBER: _ClassVar[int] - ACTIVE_CONSUMERS_FIELD_NUMBER: _ClassVar[int] - QUANTUM_FIELD_NUMBER: _ClassVar[int] - PER_KEY_STATS_FIELD_NUMBER: _ClassVar[int] - PER_THROTTLE_STATS_FIELD_NUMBER: _ClassVar[int] - LEADER_NODE_ID_FIELD_NUMBER: _ClassVar[int] - REPLICATION_COUNT_FIELD_NUMBER: _ClassVar[int] - depth: int - in_flight: int - active_fairness_keys: int - active_consumers: int - quantum: int - per_key_stats: _containers.RepeatedCompositeFieldContainer[PerFairnessKeyStats] - per_throttle_stats: _containers.RepeatedCompositeFieldContainer[PerThrottleKeyStats] - leader_node_id: int - replication_count: int - def __init__(self, depth: _Optional[int] = ..., in_flight: _Optional[int] = ..., active_fairness_keys: _Optional[int] = ..., active_consumers: _Optional[int] = ..., quantum: _Optional[int] = ..., per_key_stats: _Optional[_Iterable[_Union[PerFairnessKeyStats, _Mapping]]] = ..., per_throttle_stats: _Optional[_Iterable[_Union[PerThrottleKeyStats, _Mapping]]] = ..., leader_node_id: _Optional[int] = ..., replication_count: _Optional[int] = ...) -> None: ... - -class RedriveRequest(_message.Message): - __slots__ = ("dlq_queue", "count") - DLQ_QUEUE_FIELD_NUMBER: _ClassVar[int] - COUNT_FIELD_NUMBER: _ClassVar[int] - dlq_queue: str - count: int - def __init__(self, dlq_queue: _Optional[str] = ..., count: _Optional[int] = ...) -> None: ... - -class RedriveResponse(_message.Message): - __slots__ = ("redriven",) - REDRIVEN_FIELD_NUMBER: _ClassVar[int] - redriven: int - def __init__(self, redriven: _Optional[int] = ...) -> None: ... - -class ListQueuesRequest(_message.Message): - __slots__ = () - def __init__(self) -> None: ... - -class QueueInfo(_message.Message): - __slots__ = ("name", "depth", "in_flight", "active_consumers", "leader_node_id") - NAME_FIELD_NUMBER: _ClassVar[int] - DEPTH_FIELD_NUMBER: _ClassVar[int] - IN_FLIGHT_FIELD_NUMBER: _ClassVar[int] - ACTIVE_CONSUMERS_FIELD_NUMBER: _ClassVar[int] - LEADER_NODE_ID_FIELD_NUMBER: _ClassVar[int] - name: str - depth: int - in_flight: int - active_consumers: int - leader_node_id: int - def __init__(self, name: _Optional[str] = ..., depth: _Optional[int] = ..., in_flight: _Optional[int] = ..., active_consumers: _Optional[int] = ..., leader_node_id: _Optional[int] = ...) -> None: ... - -class ListQueuesResponse(_message.Message): - __slots__ = ("queues", "cluster_node_count") - QUEUES_FIELD_NUMBER: _ClassVar[int] - CLUSTER_NODE_COUNT_FIELD_NUMBER: _ClassVar[int] - queues: _containers.RepeatedCompositeFieldContainer[QueueInfo] - cluster_node_count: int - def __init__(self, queues: _Optional[_Iterable[_Union[QueueInfo, _Mapping]]] = ..., cluster_node_count: _Optional[int] = ...) -> None: ... diff --git a/fila/v1/admin_pb2_grpc.py b/fila/v1/admin_pb2_grpc.py deleted file mode 100644 index 3b07e1a..0000000 --- a/fila/v1/admin_pb2_grpc.py +++ /dev/null @@ -1,401 +0,0 @@ -# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! -"""Client and server classes corresponding to protobuf-defined services.""" -import grpc -import warnings - -from fila.v1 import admin_pb2 as fila_dot_v1_dot_admin__pb2 - -GRPC_GENERATED_VERSION = '1.78.0' -GRPC_VERSION = grpc.__version__ -_version_not_supported = False - -try: - from grpc._utilities import first_version_is_lower - _version_not_supported = first_version_is_lower(GRPC_VERSION, GRPC_GENERATED_VERSION) -except ImportError: - _version_not_supported = True - -if _version_not_supported: - raise RuntimeError( - f'The grpc package installed is at version {GRPC_VERSION},' - + ' but the generated code in fila/v1/admin_pb2_grpc.py depends on' - + f' grpcio>={GRPC_GENERATED_VERSION}.' - + f' Please upgrade your grpc module to grpcio>={GRPC_GENERATED_VERSION}' - + f' or downgrade your generated code using grpcio-tools<={GRPC_VERSION}.' - ) - - -class FilaAdminStub(object): - """Admin RPCs for operators and the CLI. - """ - - def __init__(self, channel): - """Constructor. - - Args: - channel: A grpc.Channel. - """ - self.CreateQueue = channel.unary_unary( - '/fila.v1.FilaAdmin/CreateQueue', - request_serializer=fila_dot_v1_dot_admin__pb2.CreateQueueRequest.SerializeToString, - response_deserializer=fila_dot_v1_dot_admin__pb2.CreateQueueResponse.FromString, - _registered_method=True) - self.DeleteQueue = channel.unary_unary( - '/fila.v1.FilaAdmin/DeleteQueue', - request_serializer=fila_dot_v1_dot_admin__pb2.DeleteQueueRequest.SerializeToString, - response_deserializer=fila_dot_v1_dot_admin__pb2.DeleteQueueResponse.FromString, - _registered_method=True) - self.SetConfig = channel.unary_unary( - '/fila.v1.FilaAdmin/SetConfig', - request_serializer=fila_dot_v1_dot_admin__pb2.SetConfigRequest.SerializeToString, - response_deserializer=fila_dot_v1_dot_admin__pb2.SetConfigResponse.FromString, - _registered_method=True) - self.GetConfig = channel.unary_unary( - '/fila.v1.FilaAdmin/GetConfig', - request_serializer=fila_dot_v1_dot_admin__pb2.GetConfigRequest.SerializeToString, - response_deserializer=fila_dot_v1_dot_admin__pb2.GetConfigResponse.FromString, - _registered_method=True) - self.ListConfig = channel.unary_unary( - '/fila.v1.FilaAdmin/ListConfig', - request_serializer=fila_dot_v1_dot_admin__pb2.ListConfigRequest.SerializeToString, - response_deserializer=fila_dot_v1_dot_admin__pb2.ListConfigResponse.FromString, - _registered_method=True) - self.GetStats = channel.unary_unary( - '/fila.v1.FilaAdmin/GetStats', - request_serializer=fila_dot_v1_dot_admin__pb2.GetStatsRequest.SerializeToString, - response_deserializer=fila_dot_v1_dot_admin__pb2.GetStatsResponse.FromString, - _registered_method=True) - self.Redrive = channel.unary_unary( - '/fila.v1.FilaAdmin/Redrive', - request_serializer=fila_dot_v1_dot_admin__pb2.RedriveRequest.SerializeToString, - response_deserializer=fila_dot_v1_dot_admin__pb2.RedriveResponse.FromString, - _registered_method=True) - self.ListQueues = channel.unary_unary( - '/fila.v1.FilaAdmin/ListQueues', - request_serializer=fila_dot_v1_dot_admin__pb2.ListQueuesRequest.SerializeToString, - response_deserializer=fila_dot_v1_dot_admin__pb2.ListQueuesResponse.FromString, - _registered_method=True) - - -class FilaAdminServicer(object): - """Admin RPCs for operators and the CLI. - """ - - def CreateQueue(self, request, context): - """Missing associated documentation comment in .proto file.""" - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - def DeleteQueue(self, request, context): - """Missing associated documentation comment in .proto file.""" - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - def SetConfig(self, request, context): - """Missing associated documentation comment in .proto file.""" - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - def GetConfig(self, request, context): - """Missing associated documentation comment in .proto file.""" - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - def ListConfig(self, request, context): - """Missing associated documentation comment in .proto file.""" - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - def GetStats(self, request, context): - """Missing associated documentation comment in .proto file.""" - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - def Redrive(self, request, context): - """Missing associated documentation comment in .proto file.""" - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - def ListQueues(self, request, context): - """Missing associated documentation comment in .proto file.""" - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - -def add_FilaAdminServicer_to_server(servicer, server): - rpc_method_handlers = { - 'CreateQueue': grpc.unary_unary_rpc_method_handler( - servicer.CreateQueue, - request_deserializer=fila_dot_v1_dot_admin__pb2.CreateQueueRequest.FromString, - response_serializer=fila_dot_v1_dot_admin__pb2.CreateQueueResponse.SerializeToString, - ), - 'DeleteQueue': grpc.unary_unary_rpc_method_handler( - servicer.DeleteQueue, - request_deserializer=fila_dot_v1_dot_admin__pb2.DeleteQueueRequest.FromString, - response_serializer=fila_dot_v1_dot_admin__pb2.DeleteQueueResponse.SerializeToString, - ), - 'SetConfig': grpc.unary_unary_rpc_method_handler( - servicer.SetConfig, - request_deserializer=fila_dot_v1_dot_admin__pb2.SetConfigRequest.FromString, - response_serializer=fila_dot_v1_dot_admin__pb2.SetConfigResponse.SerializeToString, - ), - 'GetConfig': grpc.unary_unary_rpc_method_handler( - servicer.GetConfig, - request_deserializer=fila_dot_v1_dot_admin__pb2.GetConfigRequest.FromString, - response_serializer=fila_dot_v1_dot_admin__pb2.GetConfigResponse.SerializeToString, - ), - 'ListConfig': grpc.unary_unary_rpc_method_handler( - servicer.ListConfig, - request_deserializer=fila_dot_v1_dot_admin__pb2.ListConfigRequest.FromString, - response_serializer=fila_dot_v1_dot_admin__pb2.ListConfigResponse.SerializeToString, - ), - 'GetStats': grpc.unary_unary_rpc_method_handler( - servicer.GetStats, - request_deserializer=fila_dot_v1_dot_admin__pb2.GetStatsRequest.FromString, - response_serializer=fila_dot_v1_dot_admin__pb2.GetStatsResponse.SerializeToString, - ), - 'Redrive': grpc.unary_unary_rpc_method_handler( - servicer.Redrive, - request_deserializer=fila_dot_v1_dot_admin__pb2.RedriveRequest.FromString, - response_serializer=fila_dot_v1_dot_admin__pb2.RedriveResponse.SerializeToString, - ), - 'ListQueues': grpc.unary_unary_rpc_method_handler( - servicer.ListQueues, - request_deserializer=fila_dot_v1_dot_admin__pb2.ListQueuesRequest.FromString, - response_serializer=fila_dot_v1_dot_admin__pb2.ListQueuesResponse.SerializeToString, - ), - } - generic_handler = grpc.method_handlers_generic_handler( - 'fila.v1.FilaAdmin', rpc_method_handlers) - server.add_generic_rpc_handlers((generic_handler,)) - server.add_registered_method_handlers('fila.v1.FilaAdmin', rpc_method_handlers) - - - # This class is part of an EXPERIMENTAL API. -class FilaAdmin(object): - """Admin RPCs for operators and the CLI. - """ - - @staticmethod - def CreateQueue(request, - target, - options=(), - channel_credentials=None, - call_credentials=None, - insecure=False, - compression=None, - wait_for_ready=None, - timeout=None, - metadata=None): - return grpc.experimental.unary_unary( - request, - target, - '/fila.v1.FilaAdmin/CreateQueue', - fila_dot_v1_dot_admin__pb2.CreateQueueRequest.SerializeToString, - fila_dot_v1_dot_admin__pb2.CreateQueueResponse.FromString, - options, - channel_credentials, - insecure, - call_credentials, - compression, - wait_for_ready, - timeout, - metadata, - _registered_method=True) - - @staticmethod - def DeleteQueue(request, - target, - options=(), - channel_credentials=None, - call_credentials=None, - insecure=False, - compression=None, - wait_for_ready=None, - timeout=None, - metadata=None): - return grpc.experimental.unary_unary( - request, - target, - '/fila.v1.FilaAdmin/DeleteQueue', - fila_dot_v1_dot_admin__pb2.DeleteQueueRequest.SerializeToString, - fila_dot_v1_dot_admin__pb2.DeleteQueueResponse.FromString, - options, - channel_credentials, - insecure, - call_credentials, - compression, - wait_for_ready, - timeout, - metadata, - _registered_method=True) - - @staticmethod - def SetConfig(request, - target, - options=(), - channel_credentials=None, - call_credentials=None, - insecure=False, - compression=None, - wait_for_ready=None, - timeout=None, - metadata=None): - return grpc.experimental.unary_unary( - request, - target, - '/fila.v1.FilaAdmin/SetConfig', - fila_dot_v1_dot_admin__pb2.SetConfigRequest.SerializeToString, - fila_dot_v1_dot_admin__pb2.SetConfigResponse.FromString, - options, - channel_credentials, - insecure, - call_credentials, - compression, - wait_for_ready, - timeout, - metadata, - _registered_method=True) - - @staticmethod - def GetConfig(request, - target, - options=(), - channel_credentials=None, - call_credentials=None, - insecure=False, - compression=None, - wait_for_ready=None, - timeout=None, - metadata=None): - return grpc.experimental.unary_unary( - request, - target, - '/fila.v1.FilaAdmin/GetConfig', - fila_dot_v1_dot_admin__pb2.GetConfigRequest.SerializeToString, - fila_dot_v1_dot_admin__pb2.GetConfigResponse.FromString, - options, - channel_credentials, - insecure, - call_credentials, - compression, - wait_for_ready, - timeout, - metadata, - _registered_method=True) - - @staticmethod - def ListConfig(request, - target, - options=(), - channel_credentials=None, - call_credentials=None, - insecure=False, - compression=None, - wait_for_ready=None, - timeout=None, - metadata=None): - return grpc.experimental.unary_unary( - request, - target, - '/fila.v1.FilaAdmin/ListConfig', - fila_dot_v1_dot_admin__pb2.ListConfigRequest.SerializeToString, - fila_dot_v1_dot_admin__pb2.ListConfigResponse.FromString, - options, - channel_credentials, - insecure, - call_credentials, - compression, - wait_for_ready, - timeout, - metadata, - _registered_method=True) - - @staticmethod - def GetStats(request, - target, - options=(), - channel_credentials=None, - call_credentials=None, - insecure=False, - compression=None, - wait_for_ready=None, - timeout=None, - metadata=None): - return grpc.experimental.unary_unary( - request, - target, - '/fila.v1.FilaAdmin/GetStats', - fila_dot_v1_dot_admin__pb2.GetStatsRequest.SerializeToString, - fila_dot_v1_dot_admin__pb2.GetStatsResponse.FromString, - options, - channel_credentials, - insecure, - call_credentials, - compression, - wait_for_ready, - timeout, - metadata, - _registered_method=True) - - @staticmethod - def Redrive(request, - target, - options=(), - channel_credentials=None, - call_credentials=None, - insecure=False, - compression=None, - wait_for_ready=None, - timeout=None, - metadata=None): - return grpc.experimental.unary_unary( - request, - target, - '/fila.v1.FilaAdmin/Redrive', - fila_dot_v1_dot_admin__pb2.RedriveRequest.SerializeToString, - fila_dot_v1_dot_admin__pb2.RedriveResponse.FromString, - options, - channel_credentials, - insecure, - call_credentials, - compression, - wait_for_ready, - timeout, - metadata, - _registered_method=True) - - @staticmethod - def ListQueues(request, - target, - options=(), - channel_credentials=None, - call_credentials=None, - insecure=False, - compression=None, - wait_for_ready=None, - timeout=None, - metadata=None): - return grpc.experimental.unary_unary( - request, - target, - '/fila.v1.FilaAdmin/ListQueues', - fila_dot_v1_dot_admin__pb2.ListQueuesRequest.SerializeToString, - fila_dot_v1_dot_admin__pb2.ListQueuesResponse.FromString, - options, - channel_credentials, - insecure, - call_credentials, - compression, - wait_for_ready, - timeout, - metadata, - _registered_method=True) diff --git a/fila/v1/messages_pb2.py b/fila/v1/messages_pb2.py deleted file mode 100644 index 3cf7edb..0000000 --- a/fila/v1/messages_pb2.py +++ /dev/null @@ -1,45 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by the protocol buffer compiler. DO NOT EDIT! -# NO CHECKED-IN PROTOBUF GENCODE -# source: fila/v1/messages.proto -# Protobuf Python Version: 6.31.1 -"""Generated protocol buffer code.""" -from google.protobuf import descriptor as _descriptor -from google.protobuf import descriptor_pool as _descriptor_pool -from google.protobuf import runtime_version as _runtime_version -from google.protobuf import symbol_database as _symbol_database -from google.protobuf.internal import builder as _builder -_runtime_version.ValidateProtobufRuntimeVersion( - _runtime_version.Domain.PUBLIC, - 6, - 31, - 1, - '', - 'fila/v1/messages.proto' -) -# @@protoc_insertion_point(imports) - -_sym_db = _symbol_database.Default() - - -from google.protobuf import timestamp_pb2 as google_dot_protobuf_dot_timestamp__pb2 - - -DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x16\x66ila/v1/messages.proto\x12\x07\x66ila.v1\x1a\x1fgoogle/protobuf/timestamp.proto\"\xe2\x01\n\x07Message\x12\n\n\x02id\x18\x01 \x01(\t\x12.\n\x07headers\x18\x02 \x03(\x0b\x32\x1d.fila.v1.Message.HeadersEntry\x12\x0f\n\x07payload\x18\x03 \x01(\x0c\x12*\n\x08metadata\x18\x04 \x01(\x0b\x32\x18.fila.v1.MessageMetadata\x12.\n\ntimestamps\x18\x05 \x01(\x0b\x32\x1a.fila.v1.MessageTimestamps\x1a.\n\x0cHeadersEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"w\n\x0fMessageMetadata\x12\x14\n\x0c\x66\x61irness_key\x18\x01 \x01(\t\x12\x0e\n\x06weight\x18\x02 \x01(\r\x12\x15\n\rthrottle_keys\x18\x03 \x03(\t\x12\x15\n\rattempt_count\x18\x04 \x01(\r\x12\x10\n\x08queue_id\x18\x05 \x01(\t\"s\n\x11MessageTimestamps\x12/\n\x0b\x65nqueued_at\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12-\n\tleased_at\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestampb\x06proto3') - -_globals = globals() -_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) -_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'fila.v1.messages_pb2', _globals) -if not _descriptor._USE_C_DESCRIPTORS: - DESCRIPTOR._loaded_options = None - _globals['_MESSAGE_HEADERSENTRY']._loaded_options = None - _globals['_MESSAGE_HEADERSENTRY']._serialized_options = b'8\001' - _globals['_MESSAGE']._serialized_start=69 - _globals['_MESSAGE']._serialized_end=295 - _globals['_MESSAGE_HEADERSENTRY']._serialized_start=249 - _globals['_MESSAGE_HEADERSENTRY']._serialized_end=295 - _globals['_MESSAGEMETADATA']._serialized_start=297 - _globals['_MESSAGEMETADATA']._serialized_end=416 - _globals['_MESSAGETIMESTAMPS']._serialized_start=418 - _globals['_MESSAGETIMESTAMPS']._serialized_end=533 -# @@protoc_insertion_point(module_scope) diff --git a/fila/v1/messages_pb2.pyi b/fila/v1/messages_pb2.pyi deleted file mode 100644 index a91bb74..0000000 --- a/fila/v1/messages_pb2.pyi +++ /dev/null @@ -1,53 +0,0 @@ -import datetime - -from google.protobuf import timestamp_pb2 as _timestamp_pb2 -from google.protobuf.internal import containers as _containers -from google.protobuf import descriptor as _descriptor -from google.protobuf import message as _message -from collections.abc import Iterable as _Iterable, Mapping as _Mapping -from typing import ClassVar as _ClassVar, Optional as _Optional, Union as _Union - -DESCRIPTOR: _descriptor.FileDescriptor - -class Message(_message.Message): - __slots__ = ("id", "headers", "payload", "metadata", "timestamps") - class HeadersEntry(_message.Message): - __slots__ = ("key", "value") - KEY_FIELD_NUMBER: _ClassVar[int] - VALUE_FIELD_NUMBER: _ClassVar[int] - key: str - value: str - def __init__(self, key: _Optional[str] = ..., value: _Optional[str] = ...) -> None: ... - ID_FIELD_NUMBER: _ClassVar[int] - HEADERS_FIELD_NUMBER: _ClassVar[int] - PAYLOAD_FIELD_NUMBER: _ClassVar[int] - METADATA_FIELD_NUMBER: _ClassVar[int] - TIMESTAMPS_FIELD_NUMBER: _ClassVar[int] - id: str - headers: _containers.ScalarMap[str, str] - payload: bytes - metadata: MessageMetadata - timestamps: MessageTimestamps - def __init__(self, id: _Optional[str] = ..., headers: _Optional[_Mapping[str, str]] = ..., payload: _Optional[bytes] = ..., metadata: _Optional[_Union[MessageMetadata, _Mapping]] = ..., timestamps: _Optional[_Union[MessageTimestamps, _Mapping]] = ...) -> None: ... - -class MessageMetadata(_message.Message): - __slots__ = ("fairness_key", "weight", "throttle_keys", "attempt_count", "queue_id") - FAIRNESS_KEY_FIELD_NUMBER: _ClassVar[int] - WEIGHT_FIELD_NUMBER: _ClassVar[int] - THROTTLE_KEYS_FIELD_NUMBER: _ClassVar[int] - ATTEMPT_COUNT_FIELD_NUMBER: _ClassVar[int] - QUEUE_ID_FIELD_NUMBER: _ClassVar[int] - fairness_key: str - weight: int - throttle_keys: _containers.RepeatedScalarFieldContainer[str] - attempt_count: int - queue_id: str - def __init__(self, fairness_key: _Optional[str] = ..., weight: _Optional[int] = ..., throttle_keys: _Optional[_Iterable[str]] = ..., attempt_count: _Optional[int] = ..., queue_id: _Optional[str] = ...) -> None: ... - -class MessageTimestamps(_message.Message): - __slots__ = ("enqueued_at", "leased_at") - ENQUEUED_AT_FIELD_NUMBER: _ClassVar[int] - LEASED_AT_FIELD_NUMBER: _ClassVar[int] - enqueued_at: _timestamp_pb2.Timestamp - leased_at: _timestamp_pb2.Timestamp - def __init__(self, enqueued_at: _Optional[_Union[datetime.datetime, _timestamp_pb2.Timestamp, _Mapping]] = ..., leased_at: _Optional[_Union[datetime.datetime, _timestamp_pb2.Timestamp, _Mapping]] = ...) -> None: ... diff --git a/fila/v1/messages_pb2_grpc.py b/fila/v1/messages_pb2_grpc.py deleted file mode 100644 index fa0dc71..0000000 --- a/fila/v1/messages_pb2_grpc.py +++ /dev/null @@ -1,24 +0,0 @@ -# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! -"""Client and server classes corresponding to protobuf-defined services.""" -import grpc -import warnings - - -GRPC_GENERATED_VERSION = '1.78.0' -GRPC_VERSION = grpc.__version__ -_version_not_supported = False - -try: - from grpc._utilities import first_version_is_lower - _version_not_supported = first_version_is_lower(GRPC_VERSION, GRPC_GENERATED_VERSION) -except ImportError: - _version_not_supported = True - -if _version_not_supported: - raise RuntimeError( - f'The grpc package installed is at version {GRPC_VERSION},' - + ' but the generated code in fila/v1/messages_pb2_grpc.py depends on' - + f' grpcio>={GRPC_GENERATED_VERSION}.' - + f' Please upgrade your grpc module to grpcio>={GRPC_GENERATED_VERSION}' - + f' or downgrade your generated code using grpcio-tools<={GRPC_VERSION}.' - ) diff --git a/fila/v1/service_pb2.py b/fila/v1/service_pb2.py deleted file mode 100644 index 7489260..0000000 --- a/fila/v1/service_pb2.py +++ /dev/null @@ -1,89 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by the protocol buffer compiler. DO NOT EDIT! -# NO CHECKED-IN PROTOBUF GENCODE -# source: fila/v1/service.proto -# Protobuf Python Version: 6.31.1 -"""Generated protocol buffer code.""" -from google.protobuf import descriptor as _descriptor -from google.protobuf import descriptor_pool as _descriptor_pool -from google.protobuf import runtime_version as _runtime_version -from google.protobuf import symbol_database as _symbol_database -from google.protobuf.internal import builder as _builder -_runtime_version.ValidateProtobufRuntimeVersion( - _runtime_version.Domain.PUBLIC, - 6, - 31, - 1, - '', - 'fila/v1/service.proto' -) -# @@protoc_insertion_point(imports) - -_sym_db = _symbol_database.Default() - - -from fila.v1 import messages_pb2 as fila_dot_v1_dot_messages__pb2 - - -DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x15\x66ila/v1/service.proto\x12\x07\x66ila.v1\x1a\x16\x66ila/v1/messages.proto\"\x97\x01\n\x0e\x45nqueueMessage\x12\r\n\x05queue\x18\x01 \x01(\t\x12\x35\n\x07headers\x18\x02 \x03(\x0b\x32$.fila.v1.EnqueueMessage.HeadersEntry\x12\x0f\n\x07payload\x18\x03 \x01(\x0c\x1a.\n\x0cHeadersEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\";\n\x0e\x45nqueueRequest\x12)\n\x08messages\x18\x01 \x03(\x0b\x32\x17.fila.v1.EnqueueMessage\"W\n\rEnqueueResult\x12\x14\n\nmessage_id\x18\x01 \x01(\tH\x00\x12&\n\x05\x65rror\x18\x02 \x01(\x0b\x32\x15.fila.v1.EnqueueErrorH\x00\x42\x08\n\x06result\"H\n\x0c\x45nqueueError\x12\'\n\x04\x63ode\x18\x01 \x01(\x0e\x32\x19.fila.v1.EnqueueErrorCode\x12\x0f\n\x07message\x18\x02 \x01(\t\":\n\x0f\x45nqueueResponse\x12\'\n\x07results\x18\x01 \x03(\x0b\x32\x16.fila.v1.EnqueueResult\"\x1f\n\x0e\x43onsumeRequest\x12\r\n\x05queue\x18\x01 \x01(\t\"5\n\x0f\x43onsumeResponse\x12\"\n\x08messages\x18\x01 \x03(\x0b\x32\x10.fila.v1.Message\"/\n\nAckMessage\x12\r\n\x05queue\x18\x01 \x01(\t\x12\x12\n\nmessage_id\x18\x02 \x01(\t\"3\n\nAckRequest\x12%\n\x08messages\x18\x01 \x03(\x0b\x32\x13.fila.v1.AckMessage\"a\n\tAckResult\x12&\n\x07success\x18\x01 \x01(\x0b\x32\x13.fila.v1.AckSuccessH\x00\x12\"\n\x05\x65rror\x18\x02 \x01(\x0b\x32\x11.fila.v1.AckErrorH\x00\x42\x08\n\x06result\"\x0c\n\nAckSuccess\"@\n\x08\x41\x63kError\x12#\n\x04\x63ode\x18\x01 \x01(\x0e\x32\x15.fila.v1.AckErrorCode\x12\x0f\n\x07message\x18\x02 \x01(\t\"2\n\x0b\x41\x63kResponse\x12#\n\x07results\x18\x01 \x03(\x0b\x32\x12.fila.v1.AckResult\"?\n\x0bNackMessage\x12\r\n\x05queue\x18\x01 \x01(\t\x12\x12\n\nmessage_id\x18\x02 \x01(\t\x12\r\n\x05\x65rror\x18\x03 \x01(\t\"5\n\x0bNackRequest\x12&\n\x08messages\x18\x01 \x03(\x0b\x32\x14.fila.v1.NackMessage\"d\n\nNackResult\x12\'\n\x07success\x18\x01 \x01(\x0b\x32\x14.fila.v1.NackSuccessH\x00\x12#\n\x05\x65rror\x18\x02 \x01(\x0b\x32\x12.fila.v1.NackErrorH\x00\x42\x08\n\x06result\"\r\n\x0bNackSuccess\"B\n\tNackError\x12$\n\x04\x63ode\x18\x01 \x01(\x0e\x32\x16.fila.v1.NackErrorCode\x12\x0f\n\x07message\x18\x02 \x01(\t\"4\n\x0cNackResponse\x12$\n\x07results\x18\x01 \x03(\x0b\x32\x13.fila.v1.NackResult\"Z\n\x14StreamEnqueueRequest\x12)\n\x08messages\x18\x01 \x03(\x0b\x32\x17.fila.v1.EnqueueMessage\x12\x17\n\x0fsequence_number\x18\x02 \x01(\x04\"Y\n\x15StreamEnqueueResponse\x12\x17\n\x0fsequence_number\x18\x01 \x01(\x04\x12\'\n\x07results\x18\x02 \x03(\x0b\x32\x16.fila.v1.EnqueueResult*\xc4\x01\n\x10\x45nqueueErrorCode\x12\"\n\x1e\x45NQUEUE_ERROR_CODE_UNSPECIFIED\x10\x00\x12&\n\"ENQUEUE_ERROR_CODE_QUEUE_NOT_FOUND\x10\x01\x12\x1e\n\x1a\x45NQUEUE_ERROR_CODE_STORAGE\x10\x02\x12\x1a\n\x16\x45NQUEUE_ERROR_CODE_LUA\x10\x03\x12(\n$ENQUEUE_ERROR_CODE_PERMISSION_DENIED\x10\x04*\x96\x01\n\x0c\x41\x63kErrorCode\x12\x1e\n\x1a\x41\x43K_ERROR_CODE_UNSPECIFIED\x10\x00\x12$\n ACK_ERROR_CODE_MESSAGE_NOT_FOUND\x10\x01\x12\x1a\n\x16\x41\x43K_ERROR_CODE_STORAGE\x10\x02\x12$\n ACK_ERROR_CODE_PERMISSION_DENIED\x10\x03*\x9b\x01\n\rNackErrorCode\x12\x1f\n\x1bNACK_ERROR_CODE_UNSPECIFIED\x10\x00\x12%\n!NACK_ERROR_CODE_MESSAGE_NOT_FOUND\x10\x01\x12\x1b\n\x17NACK_ERROR_CODE_STORAGE\x10\x02\x12%\n!NACK_ERROR_CODE_PERMISSION_DENIED\x10\x03\x32\xc6\x02\n\x0b\x46ilaService\x12<\n\x07\x45nqueue\x12\x17.fila.v1.EnqueueRequest\x1a\x18.fila.v1.EnqueueResponse\x12R\n\rStreamEnqueue\x12\x1d.fila.v1.StreamEnqueueRequest\x1a\x1e.fila.v1.StreamEnqueueResponse(\x01\x30\x01\x12>\n\x07\x43onsume\x12\x17.fila.v1.ConsumeRequest\x1a\x18.fila.v1.ConsumeResponse0\x01\x12\x30\n\x03\x41\x63k\x12\x13.fila.v1.AckRequest\x1a\x14.fila.v1.AckResponse\x12\x33\n\x04Nack\x12\x14.fila.v1.NackRequest\x1a\x15.fila.v1.NackResponseb\x06proto3') - -_globals = globals() -_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) -_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'fila.v1.service_pb2', _globals) -if not _descriptor._USE_C_DESCRIPTORS: - DESCRIPTOR._loaded_options = None - _globals['_ENQUEUEMESSAGE_HEADERSENTRY']._loaded_options = None - _globals['_ENQUEUEMESSAGE_HEADERSENTRY']._serialized_options = b'8\001' - _globals['_ENQUEUEERRORCODE']._serialized_start=1460 - _globals['_ENQUEUEERRORCODE']._serialized_end=1656 - _globals['_ACKERRORCODE']._serialized_start=1659 - _globals['_ACKERRORCODE']._serialized_end=1809 - _globals['_NACKERRORCODE']._serialized_start=1812 - _globals['_NACKERRORCODE']._serialized_end=1967 - _globals['_ENQUEUEMESSAGE']._serialized_start=59 - _globals['_ENQUEUEMESSAGE']._serialized_end=210 - _globals['_ENQUEUEMESSAGE_HEADERSENTRY']._serialized_start=164 - _globals['_ENQUEUEMESSAGE_HEADERSENTRY']._serialized_end=210 - _globals['_ENQUEUEREQUEST']._serialized_start=212 - _globals['_ENQUEUEREQUEST']._serialized_end=271 - _globals['_ENQUEUERESULT']._serialized_start=273 - _globals['_ENQUEUERESULT']._serialized_end=360 - _globals['_ENQUEUEERROR']._serialized_start=362 - _globals['_ENQUEUEERROR']._serialized_end=434 - _globals['_ENQUEUERESPONSE']._serialized_start=436 - _globals['_ENQUEUERESPONSE']._serialized_end=494 - _globals['_CONSUMEREQUEST']._serialized_start=496 - _globals['_CONSUMEREQUEST']._serialized_end=527 - _globals['_CONSUMERESPONSE']._serialized_start=529 - _globals['_CONSUMERESPONSE']._serialized_end=582 - _globals['_ACKMESSAGE']._serialized_start=584 - _globals['_ACKMESSAGE']._serialized_end=631 - _globals['_ACKREQUEST']._serialized_start=633 - _globals['_ACKREQUEST']._serialized_end=684 - _globals['_ACKRESULT']._serialized_start=686 - _globals['_ACKRESULT']._serialized_end=783 - _globals['_ACKSUCCESS']._serialized_start=785 - _globals['_ACKSUCCESS']._serialized_end=797 - _globals['_ACKERROR']._serialized_start=799 - _globals['_ACKERROR']._serialized_end=863 - _globals['_ACKRESPONSE']._serialized_start=865 - _globals['_ACKRESPONSE']._serialized_end=915 - _globals['_NACKMESSAGE']._serialized_start=917 - _globals['_NACKMESSAGE']._serialized_end=980 - _globals['_NACKREQUEST']._serialized_start=982 - _globals['_NACKREQUEST']._serialized_end=1035 - _globals['_NACKRESULT']._serialized_start=1037 - _globals['_NACKRESULT']._serialized_end=1137 - _globals['_NACKSUCCESS']._serialized_start=1139 - _globals['_NACKSUCCESS']._serialized_end=1152 - _globals['_NACKERROR']._serialized_start=1154 - _globals['_NACKERROR']._serialized_end=1220 - _globals['_NACKRESPONSE']._serialized_start=1222 - _globals['_NACKRESPONSE']._serialized_end=1274 - _globals['_STREAMENQUEUEREQUEST']._serialized_start=1276 - _globals['_STREAMENQUEUEREQUEST']._serialized_end=1366 - _globals['_STREAMENQUEUERESPONSE']._serialized_start=1368 - _globals['_STREAMENQUEUERESPONSE']._serialized_end=1457 - _globals['_FILASERVICE']._serialized_start=1970 - _globals['_FILASERVICE']._serialized_end=2296 -# @@protoc_insertion_point(module_scope) diff --git a/fila/v1/service_pb2.pyi b/fila/v1/service_pb2.pyi deleted file mode 100644 index a840197..0000000 --- a/fila/v1/service_pb2.pyi +++ /dev/null @@ -1,199 +0,0 @@ -from fila.v1 import messages_pb2 as _messages_pb2 -from google.protobuf.internal import containers as _containers -from google.protobuf.internal import enum_type_wrapper as _enum_type_wrapper -from google.protobuf import descriptor as _descriptor -from google.protobuf import message as _message -from collections.abc import Iterable as _Iterable, Mapping as _Mapping -from typing import ClassVar as _ClassVar, Optional as _Optional, Union as _Union - -DESCRIPTOR: _descriptor.FileDescriptor - -class EnqueueErrorCode(int, metaclass=_enum_type_wrapper.EnumTypeWrapper): - __slots__ = () - ENQUEUE_ERROR_CODE_UNSPECIFIED: _ClassVar[EnqueueErrorCode] - ENQUEUE_ERROR_CODE_QUEUE_NOT_FOUND: _ClassVar[EnqueueErrorCode] - ENQUEUE_ERROR_CODE_STORAGE: _ClassVar[EnqueueErrorCode] - ENQUEUE_ERROR_CODE_LUA: _ClassVar[EnqueueErrorCode] - ENQUEUE_ERROR_CODE_PERMISSION_DENIED: _ClassVar[EnqueueErrorCode] - -class AckErrorCode(int, metaclass=_enum_type_wrapper.EnumTypeWrapper): - __slots__ = () - ACK_ERROR_CODE_UNSPECIFIED: _ClassVar[AckErrorCode] - ACK_ERROR_CODE_MESSAGE_NOT_FOUND: _ClassVar[AckErrorCode] - ACK_ERROR_CODE_STORAGE: _ClassVar[AckErrorCode] - ACK_ERROR_CODE_PERMISSION_DENIED: _ClassVar[AckErrorCode] - -class NackErrorCode(int, metaclass=_enum_type_wrapper.EnumTypeWrapper): - __slots__ = () - NACK_ERROR_CODE_UNSPECIFIED: _ClassVar[NackErrorCode] - NACK_ERROR_CODE_MESSAGE_NOT_FOUND: _ClassVar[NackErrorCode] - NACK_ERROR_CODE_STORAGE: _ClassVar[NackErrorCode] - NACK_ERROR_CODE_PERMISSION_DENIED: _ClassVar[NackErrorCode] -ENQUEUE_ERROR_CODE_UNSPECIFIED: EnqueueErrorCode -ENQUEUE_ERROR_CODE_QUEUE_NOT_FOUND: EnqueueErrorCode -ENQUEUE_ERROR_CODE_STORAGE: EnqueueErrorCode -ENQUEUE_ERROR_CODE_LUA: EnqueueErrorCode -ENQUEUE_ERROR_CODE_PERMISSION_DENIED: EnqueueErrorCode -ACK_ERROR_CODE_UNSPECIFIED: AckErrorCode -ACK_ERROR_CODE_MESSAGE_NOT_FOUND: AckErrorCode -ACK_ERROR_CODE_STORAGE: AckErrorCode -ACK_ERROR_CODE_PERMISSION_DENIED: AckErrorCode -NACK_ERROR_CODE_UNSPECIFIED: NackErrorCode -NACK_ERROR_CODE_MESSAGE_NOT_FOUND: NackErrorCode -NACK_ERROR_CODE_STORAGE: NackErrorCode -NACK_ERROR_CODE_PERMISSION_DENIED: NackErrorCode - -class EnqueueMessage(_message.Message): - __slots__ = ("queue", "headers", "payload") - class HeadersEntry(_message.Message): - __slots__ = ("key", "value") - KEY_FIELD_NUMBER: _ClassVar[int] - VALUE_FIELD_NUMBER: _ClassVar[int] - key: str - value: str - def __init__(self, key: _Optional[str] = ..., value: _Optional[str] = ...) -> None: ... - QUEUE_FIELD_NUMBER: _ClassVar[int] - HEADERS_FIELD_NUMBER: _ClassVar[int] - PAYLOAD_FIELD_NUMBER: _ClassVar[int] - queue: str - headers: _containers.ScalarMap[str, str] - payload: bytes - def __init__(self, queue: _Optional[str] = ..., headers: _Optional[_Mapping[str, str]] = ..., payload: _Optional[bytes] = ...) -> None: ... - -class EnqueueRequest(_message.Message): - __slots__ = ("messages",) - MESSAGES_FIELD_NUMBER: _ClassVar[int] - messages: _containers.RepeatedCompositeFieldContainer[EnqueueMessage] - def __init__(self, messages: _Optional[_Iterable[_Union[EnqueueMessage, _Mapping]]] = ...) -> None: ... - -class EnqueueResult(_message.Message): - __slots__ = ("message_id", "error") - MESSAGE_ID_FIELD_NUMBER: _ClassVar[int] - ERROR_FIELD_NUMBER: _ClassVar[int] - message_id: str - error: EnqueueError - def __init__(self, message_id: _Optional[str] = ..., error: _Optional[_Union[EnqueueError, _Mapping]] = ...) -> None: ... - -class EnqueueError(_message.Message): - __slots__ = ("code", "message") - CODE_FIELD_NUMBER: _ClassVar[int] - MESSAGE_FIELD_NUMBER: _ClassVar[int] - code: EnqueueErrorCode - message: str - def __init__(self, code: _Optional[_Union[EnqueueErrorCode, str]] = ..., message: _Optional[str] = ...) -> None: ... - -class EnqueueResponse(_message.Message): - __slots__ = ("results",) - RESULTS_FIELD_NUMBER: _ClassVar[int] - results: _containers.RepeatedCompositeFieldContainer[EnqueueResult] - def __init__(self, results: _Optional[_Iterable[_Union[EnqueueResult, _Mapping]]] = ...) -> None: ... - -class ConsumeRequest(_message.Message): - __slots__ = ("queue",) - QUEUE_FIELD_NUMBER: _ClassVar[int] - queue: str - def __init__(self, queue: _Optional[str] = ...) -> None: ... - -class ConsumeResponse(_message.Message): - __slots__ = ("messages",) - MESSAGES_FIELD_NUMBER: _ClassVar[int] - messages: _containers.RepeatedCompositeFieldContainer[_messages_pb2.Message] - def __init__(self, messages: _Optional[_Iterable[_Union[_messages_pb2.Message, _Mapping]]] = ...) -> None: ... - -class AckMessage(_message.Message): - __slots__ = ("queue", "message_id") - QUEUE_FIELD_NUMBER: _ClassVar[int] - MESSAGE_ID_FIELD_NUMBER: _ClassVar[int] - queue: str - message_id: str - def __init__(self, queue: _Optional[str] = ..., message_id: _Optional[str] = ...) -> None: ... - -class AckRequest(_message.Message): - __slots__ = ("messages",) - MESSAGES_FIELD_NUMBER: _ClassVar[int] - messages: _containers.RepeatedCompositeFieldContainer[AckMessage] - def __init__(self, messages: _Optional[_Iterable[_Union[AckMessage, _Mapping]]] = ...) -> None: ... - -class AckResult(_message.Message): - __slots__ = ("success", "error") - SUCCESS_FIELD_NUMBER: _ClassVar[int] - ERROR_FIELD_NUMBER: _ClassVar[int] - success: AckSuccess - error: AckError - def __init__(self, success: _Optional[_Union[AckSuccess, _Mapping]] = ..., error: _Optional[_Union[AckError, _Mapping]] = ...) -> None: ... - -class AckSuccess(_message.Message): - __slots__ = () - def __init__(self) -> None: ... - -class AckError(_message.Message): - __slots__ = ("code", "message") - CODE_FIELD_NUMBER: _ClassVar[int] - MESSAGE_FIELD_NUMBER: _ClassVar[int] - code: AckErrorCode - message: str - def __init__(self, code: _Optional[_Union[AckErrorCode, str]] = ..., message: _Optional[str] = ...) -> None: ... - -class AckResponse(_message.Message): - __slots__ = ("results",) - RESULTS_FIELD_NUMBER: _ClassVar[int] - results: _containers.RepeatedCompositeFieldContainer[AckResult] - def __init__(self, results: _Optional[_Iterable[_Union[AckResult, _Mapping]]] = ...) -> None: ... - -class NackMessage(_message.Message): - __slots__ = ("queue", "message_id", "error") - QUEUE_FIELD_NUMBER: _ClassVar[int] - MESSAGE_ID_FIELD_NUMBER: _ClassVar[int] - ERROR_FIELD_NUMBER: _ClassVar[int] - queue: str - message_id: str - error: str - def __init__(self, queue: _Optional[str] = ..., message_id: _Optional[str] = ..., error: _Optional[str] = ...) -> None: ... - -class NackRequest(_message.Message): - __slots__ = ("messages",) - MESSAGES_FIELD_NUMBER: _ClassVar[int] - messages: _containers.RepeatedCompositeFieldContainer[NackMessage] - def __init__(self, messages: _Optional[_Iterable[_Union[NackMessage, _Mapping]]] = ...) -> None: ... - -class NackResult(_message.Message): - __slots__ = ("success", "error") - SUCCESS_FIELD_NUMBER: _ClassVar[int] - ERROR_FIELD_NUMBER: _ClassVar[int] - success: NackSuccess - error: NackError - def __init__(self, success: _Optional[_Union[NackSuccess, _Mapping]] = ..., error: _Optional[_Union[NackError, _Mapping]] = ...) -> None: ... - -class NackSuccess(_message.Message): - __slots__ = () - def __init__(self) -> None: ... - -class NackError(_message.Message): - __slots__ = ("code", "message") - CODE_FIELD_NUMBER: _ClassVar[int] - MESSAGE_FIELD_NUMBER: _ClassVar[int] - code: NackErrorCode - message: str - def __init__(self, code: _Optional[_Union[NackErrorCode, str]] = ..., message: _Optional[str] = ...) -> None: ... - -class NackResponse(_message.Message): - __slots__ = ("results",) - RESULTS_FIELD_NUMBER: _ClassVar[int] - results: _containers.RepeatedCompositeFieldContainer[NackResult] - def __init__(self, results: _Optional[_Iterable[_Union[NackResult, _Mapping]]] = ...) -> None: ... - -class StreamEnqueueRequest(_message.Message): - __slots__ = ("messages", "sequence_number") - MESSAGES_FIELD_NUMBER: _ClassVar[int] - SEQUENCE_NUMBER_FIELD_NUMBER: _ClassVar[int] - messages: _containers.RepeatedCompositeFieldContainer[EnqueueMessage] - sequence_number: int - def __init__(self, messages: _Optional[_Iterable[_Union[EnqueueMessage, _Mapping]]] = ..., sequence_number: _Optional[int] = ...) -> None: ... - -class StreamEnqueueResponse(_message.Message): - __slots__ = ("sequence_number", "results") - SEQUENCE_NUMBER_FIELD_NUMBER: _ClassVar[int] - RESULTS_FIELD_NUMBER: _ClassVar[int] - sequence_number: int - results: _containers.RepeatedCompositeFieldContainer[EnqueueResult] - def __init__(self, sequence_number: _Optional[int] = ..., results: _Optional[_Iterable[_Union[EnqueueResult, _Mapping]]] = ...) -> None: ... diff --git a/fila/v1/service_pb2_grpc.py b/fila/v1/service_pb2_grpc.py deleted file mode 100644 index fa3f3fd..0000000 --- a/fila/v1/service_pb2_grpc.py +++ /dev/null @@ -1,272 +0,0 @@ -# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! -"""Client and server classes corresponding to protobuf-defined services.""" -import grpc -import warnings - -from fila.v1 import service_pb2 as fila_dot_v1_dot_service__pb2 - -GRPC_GENERATED_VERSION = '1.78.0' -GRPC_VERSION = grpc.__version__ -_version_not_supported = False - -try: - from grpc._utilities import first_version_is_lower - _version_not_supported = first_version_is_lower(GRPC_VERSION, GRPC_GENERATED_VERSION) -except ImportError: - _version_not_supported = True - -if _version_not_supported: - raise RuntimeError( - f'The grpc package installed is at version {GRPC_VERSION},' - + ' but the generated code in fila/v1/service_pb2_grpc.py depends on' - + f' grpcio>={GRPC_GENERATED_VERSION}.' - + f' Please upgrade your grpc module to grpcio>={GRPC_GENERATED_VERSION}' - + f' or downgrade your generated code using grpcio-tools<={GRPC_VERSION}.' - ) - - -class FilaServiceStub(object): - """Hot-path RPCs for producers and consumers. - """ - - def __init__(self, channel): - """Constructor. - - Args: - channel: A grpc.Channel. - """ - self.Enqueue = channel.unary_unary( - '/fila.v1.FilaService/Enqueue', - request_serializer=fila_dot_v1_dot_service__pb2.EnqueueRequest.SerializeToString, - response_deserializer=fila_dot_v1_dot_service__pb2.EnqueueResponse.FromString, - _registered_method=True) - self.StreamEnqueue = channel.stream_stream( - '/fila.v1.FilaService/StreamEnqueue', - request_serializer=fila_dot_v1_dot_service__pb2.StreamEnqueueRequest.SerializeToString, - response_deserializer=fila_dot_v1_dot_service__pb2.StreamEnqueueResponse.FromString, - _registered_method=True) - self.Consume = channel.unary_stream( - '/fila.v1.FilaService/Consume', - request_serializer=fila_dot_v1_dot_service__pb2.ConsumeRequest.SerializeToString, - response_deserializer=fila_dot_v1_dot_service__pb2.ConsumeResponse.FromString, - _registered_method=True) - self.Ack = channel.unary_unary( - '/fila.v1.FilaService/Ack', - request_serializer=fila_dot_v1_dot_service__pb2.AckRequest.SerializeToString, - response_deserializer=fila_dot_v1_dot_service__pb2.AckResponse.FromString, - _registered_method=True) - self.Nack = channel.unary_unary( - '/fila.v1.FilaService/Nack', - request_serializer=fila_dot_v1_dot_service__pb2.NackRequest.SerializeToString, - response_deserializer=fila_dot_v1_dot_service__pb2.NackResponse.FromString, - _registered_method=True) - - -class FilaServiceServicer(object): - """Hot-path RPCs for producers and consumers. - """ - - def Enqueue(self, request, context): - """Missing associated documentation comment in .proto file.""" - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - def StreamEnqueue(self, request_iterator, context): - """Missing associated documentation comment in .proto file.""" - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - def Consume(self, request, context): - """Missing associated documentation comment in .proto file.""" - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - def Ack(self, request, context): - """Missing associated documentation comment in .proto file.""" - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - def Nack(self, request, context): - """Missing associated documentation comment in .proto file.""" - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - -def add_FilaServiceServicer_to_server(servicer, server): - rpc_method_handlers = { - 'Enqueue': grpc.unary_unary_rpc_method_handler( - servicer.Enqueue, - request_deserializer=fila_dot_v1_dot_service__pb2.EnqueueRequest.FromString, - response_serializer=fila_dot_v1_dot_service__pb2.EnqueueResponse.SerializeToString, - ), - 'StreamEnqueue': grpc.stream_stream_rpc_method_handler( - servicer.StreamEnqueue, - request_deserializer=fila_dot_v1_dot_service__pb2.StreamEnqueueRequest.FromString, - response_serializer=fila_dot_v1_dot_service__pb2.StreamEnqueueResponse.SerializeToString, - ), - 'Consume': grpc.unary_stream_rpc_method_handler( - servicer.Consume, - request_deserializer=fila_dot_v1_dot_service__pb2.ConsumeRequest.FromString, - response_serializer=fila_dot_v1_dot_service__pb2.ConsumeResponse.SerializeToString, - ), - 'Ack': grpc.unary_unary_rpc_method_handler( - servicer.Ack, - request_deserializer=fila_dot_v1_dot_service__pb2.AckRequest.FromString, - response_serializer=fila_dot_v1_dot_service__pb2.AckResponse.SerializeToString, - ), - 'Nack': grpc.unary_unary_rpc_method_handler( - servicer.Nack, - request_deserializer=fila_dot_v1_dot_service__pb2.NackRequest.FromString, - response_serializer=fila_dot_v1_dot_service__pb2.NackResponse.SerializeToString, - ), - } - generic_handler = grpc.method_handlers_generic_handler( - 'fila.v1.FilaService', rpc_method_handlers) - server.add_generic_rpc_handlers((generic_handler,)) - server.add_registered_method_handlers('fila.v1.FilaService', rpc_method_handlers) - - - # This class is part of an EXPERIMENTAL API. -class FilaService(object): - """Hot-path RPCs for producers and consumers. - """ - - @staticmethod - def Enqueue(request, - target, - options=(), - channel_credentials=None, - call_credentials=None, - insecure=False, - compression=None, - wait_for_ready=None, - timeout=None, - metadata=None): - return grpc.experimental.unary_unary( - request, - target, - '/fila.v1.FilaService/Enqueue', - fila_dot_v1_dot_service__pb2.EnqueueRequest.SerializeToString, - fila_dot_v1_dot_service__pb2.EnqueueResponse.FromString, - options, - channel_credentials, - insecure, - call_credentials, - compression, - wait_for_ready, - timeout, - metadata, - _registered_method=True) - - @staticmethod - def StreamEnqueue(request_iterator, - target, - options=(), - channel_credentials=None, - call_credentials=None, - insecure=False, - compression=None, - wait_for_ready=None, - timeout=None, - metadata=None): - return grpc.experimental.stream_stream( - request_iterator, - target, - '/fila.v1.FilaService/StreamEnqueue', - fila_dot_v1_dot_service__pb2.StreamEnqueueRequest.SerializeToString, - fila_dot_v1_dot_service__pb2.StreamEnqueueResponse.FromString, - options, - channel_credentials, - insecure, - call_credentials, - compression, - wait_for_ready, - timeout, - metadata, - _registered_method=True) - - @staticmethod - def Consume(request, - target, - options=(), - channel_credentials=None, - call_credentials=None, - insecure=False, - compression=None, - wait_for_ready=None, - timeout=None, - metadata=None): - return grpc.experimental.unary_stream( - request, - target, - '/fila.v1.FilaService/Consume', - fila_dot_v1_dot_service__pb2.ConsumeRequest.SerializeToString, - fila_dot_v1_dot_service__pb2.ConsumeResponse.FromString, - options, - channel_credentials, - insecure, - call_credentials, - compression, - wait_for_ready, - timeout, - metadata, - _registered_method=True) - - @staticmethod - def Ack(request, - target, - options=(), - channel_credentials=None, - call_credentials=None, - insecure=False, - compression=None, - wait_for_ready=None, - timeout=None, - metadata=None): - return grpc.experimental.unary_unary( - request, - target, - '/fila.v1.FilaService/Ack', - fila_dot_v1_dot_service__pb2.AckRequest.SerializeToString, - fila_dot_v1_dot_service__pb2.AckResponse.FromString, - options, - channel_credentials, - insecure, - call_credentials, - compression, - wait_for_ready, - timeout, - metadata, - _registered_method=True) - - @staticmethod - def Nack(request, - target, - options=(), - channel_credentials=None, - call_credentials=None, - insecure=False, - compression=None, - wait_for_ready=None, - timeout=None, - metadata=None): - return grpc.experimental.unary_unary( - request, - target, - '/fila.v1.FilaService/Nack', - fila_dot_v1_dot_service__pb2.NackRequest.SerializeToString, - fila_dot_v1_dot_service__pb2.NackResponse.FromString, - options, - channel_credentials, - insecure, - call_credentials, - compression, - wait_for_ready, - timeout, - metadata, - _registered_method=True) diff --git a/proto/fila/v1/admin.proto b/proto/fila/v1/admin.proto deleted file mode 100644 index 9bb8871..0000000 --- a/proto/fila/v1/admin.proto +++ /dev/null @@ -1,119 +0,0 @@ -syntax = "proto3"; -package fila.v1; - -// Admin RPCs for operators and the CLI. -service FilaAdmin { - rpc CreateQueue(CreateQueueRequest) returns (CreateQueueResponse); - rpc DeleteQueue(DeleteQueueRequest) returns (DeleteQueueResponse); - rpc SetConfig(SetConfigRequest) returns (SetConfigResponse); - rpc GetConfig(GetConfigRequest) returns (GetConfigResponse); - rpc ListConfig(ListConfigRequest) returns (ListConfigResponse); - rpc GetStats(GetStatsRequest) returns (GetStatsResponse); - rpc Redrive(RedriveRequest) returns (RedriveResponse); - rpc ListQueues(ListQueuesRequest) returns (ListQueuesResponse); -} - -message CreateQueueRequest { - string name = 1; - QueueConfig config = 2; -} - -message QueueConfig { - string on_enqueue_script = 1; - string on_failure_script = 2; - uint64 visibility_timeout_ms = 3; -} - -message CreateQueueResponse { - string queue_id = 1; -} - -message DeleteQueueRequest { - string queue = 1; -} - -message DeleteQueueResponse {} - -message SetConfigRequest { - string key = 1; - string value = 2; -} - -message SetConfigResponse {} - -message GetConfigRequest { - string key = 1; -} - -message GetConfigResponse { - string value = 1; -} - -message ConfigEntry { - string key = 1; - string value = 2; -} - -message ListConfigRequest { - string prefix = 1; -} - -message ListConfigResponse { - repeated ConfigEntry entries = 1; - uint32 total_count = 2; -} - -message GetStatsRequest { - string queue = 1; -} - -message PerFairnessKeyStats { - string key = 1; - uint64 pending_count = 2; - int64 current_deficit = 3; - uint32 weight = 4; -} - -message PerThrottleKeyStats { - string key = 1; - double tokens = 2; - double rate_per_second = 3; - double burst = 4; -} - -message GetStatsResponse { - uint64 depth = 1; - uint64 in_flight = 2; - uint64 active_fairness_keys = 3; - uint32 active_consumers = 4; - uint32 quantum = 5; - repeated PerFairnessKeyStats per_key_stats = 6; - repeated PerThrottleKeyStats per_throttle_stats = 7; - // Cluster fields (0 when not in cluster mode). - uint64 leader_node_id = 8; - uint32 replication_count = 9; -} - -message RedriveRequest { - string dlq_queue = 1; - uint64 count = 2; -} - -message RedriveResponse { - uint64 redriven = 1; -} - -message ListQueuesRequest {} - -message QueueInfo { - string name = 1; - uint64 depth = 2; - uint64 in_flight = 3; - uint32 active_consumers = 4; - uint64 leader_node_id = 5; -} - -message ListQueuesResponse { - repeated QueueInfo queues = 1; - uint32 cluster_node_count = 2; -} diff --git a/proto/fila/v1/messages.proto b/proto/fila/v1/messages.proto deleted file mode 100644 index a0709cf..0000000 --- a/proto/fila/v1/messages.proto +++ /dev/null @@ -1,28 +0,0 @@ -syntax = "proto3"; -package fila.v1; - -import "google/protobuf/timestamp.proto"; - -// Core message envelope persisted in the broker. -message Message { - string id = 1; - map headers = 2; - bytes payload = 3; - MessageMetadata metadata = 4; - MessageTimestamps timestamps = 5; -} - -// Broker-assigned scheduling metadata. -message MessageMetadata { - string fairness_key = 1; - uint32 weight = 2; - repeated string throttle_keys = 3; - uint32 attempt_count = 4; - string queue_id = 5; -} - -// Lifecycle timestamps attached to every message. -message MessageTimestamps { - google.protobuf.Timestamp enqueued_at = 1; - google.protobuf.Timestamp leased_at = 2; -} diff --git a/proto/fila/v1/service.proto b/proto/fila/v1/service.proto deleted file mode 100644 index 7d1db79..0000000 --- a/proto/fila/v1/service.proto +++ /dev/null @@ -1,142 +0,0 @@ -syntax = "proto3"; -package fila.v1; - -import "fila/v1/messages.proto"; - -// Hot-path RPCs for producers and consumers. -service FilaService { - rpc Enqueue(EnqueueRequest) returns (EnqueueResponse); - rpc StreamEnqueue(stream StreamEnqueueRequest) returns (stream StreamEnqueueResponse); - rpc Consume(ConsumeRequest) returns (stream ConsumeResponse); - rpc Ack(AckRequest) returns (AckResponse); - rpc Nack(NackRequest) returns (NackResponse); -} - -// Individual message to enqueue. -message EnqueueMessage { - string queue = 1; - map headers = 2; - bytes payload = 3; -} - -// Enqueue one or more messages. -message EnqueueRequest { - repeated EnqueueMessage messages = 1; -} - -// Per-message enqueue result. -message EnqueueResult { - oneof result { - string message_id = 1; - EnqueueError error = 2; - } -} - -// Typed enqueue error with structured error code. -message EnqueueError { - EnqueueErrorCode code = 1; - string message = 2; -} - -enum EnqueueErrorCode { - ENQUEUE_ERROR_CODE_UNSPECIFIED = 0; - ENQUEUE_ERROR_CODE_QUEUE_NOT_FOUND = 1; - ENQUEUE_ERROR_CODE_STORAGE = 2; - ENQUEUE_ERROR_CODE_LUA = 3; - ENQUEUE_ERROR_CODE_PERMISSION_DENIED = 4; -} - -// One result per input message. -message EnqueueResponse { - repeated EnqueueResult results = 1; -} - -message ConsumeRequest { - string queue = 1; -} - -message ConsumeResponse { - repeated Message messages = 1; -} - -// Individual ack item. -message AckMessage { - string queue = 1; - string message_id = 2; -} - -message AckRequest { - repeated AckMessage messages = 1; -} - -message AckResult { - oneof result { - AckSuccess success = 1; - AckError error = 2; - } -} - -message AckSuccess {} - -message AckError { - AckErrorCode code = 1; - string message = 2; -} - -enum AckErrorCode { - ACK_ERROR_CODE_UNSPECIFIED = 0; - ACK_ERROR_CODE_MESSAGE_NOT_FOUND = 1; - ACK_ERROR_CODE_STORAGE = 2; - ACK_ERROR_CODE_PERMISSION_DENIED = 3; -} - -message AckResponse { - repeated AckResult results = 1; -} - -// Individual nack item. -message NackMessage { - string queue = 1; - string message_id = 2; - string error = 3; -} - -message NackRequest { - repeated NackMessage messages = 1; -} - -message NackResult { - oneof result { - NackSuccess success = 1; - NackError error = 2; - } -} - -message NackSuccess {} - -message NackError { - NackErrorCode code = 1; - string message = 2; -} - -enum NackErrorCode { - NACK_ERROR_CODE_UNSPECIFIED = 0; - NACK_ERROR_CODE_MESSAGE_NOT_FOUND = 1; - NACK_ERROR_CODE_STORAGE = 2; - NACK_ERROR_CODE_PERMISSION_DENIED = 3; -} - -message NackResponse { - repeated NackResult results = 1; -} - -// Stream enqueue — per-write batch with sequence tracking. -message StreamEnqueueRequest { - repeated EnqueueMessage messages = 1; - uint64 sequence_number = 2; -} - -message StreamEnqueueResponse { - uint64 sequence_number = 1; - repeated EnqueueResult results = 2; -} diff --git a/pyproject.toml b/pyproject.toml index caad5ea..2a16031 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -9,19 +9,14 @@ description = "Python client SDK for the Fila message broker" readme = "README.md" license = "AGPL-3.0-or-later" requires-python = ">=3.10" -dependencies = [ - "protobuf>=4.25.0", -] +dependencies = [] [project.optional-dependencies] dev = [ - "grpcio>=1.60.0", - "grpcio-tools>=1.60.0", "pytest>=8.0", "pytest-asyncio>=0.23", "ruff>=0.3", "mypy>=1.8", - "mypy-protobuf>=3.5", ] [tool.setuptools.packages.find] @@ -30,7 +25,6 @@ include = ["fila*"] [tool.ruff] target-version = "py310" line-length = 100 -exclude = ["fila/v1/"] [tool.ruff.lint] select = ["E", "F", "I", "N", "UP", "B", "SIM", "TCH"] @@ -41,14 +35,6 @@ strict = true warn_return_any = true warn_unused_configs = true -[[tool.mypy.overrides]] -module = "fila.v1.*" -ignore_errors = true - -[[tool.mypy.overrides]] -module = "grpc.*" -ignore_missing_imports = true - [[tool.mypy.overrides]] module = "cryptography.*" ignore_missing_imports = true diff --git a/tests/conftest.py b/tests/conftest.py index b2969ab..1f53b64 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -17,7 +17,7 @@ if TYPE_CHECKING: from collections.abc import Generator -from fila.v1 import admin_pb2 +import struct FILA_SERVER_BIN = os.environ.get( "FILA_SERVER_BIN", @@ -169,11 +169,11 @@ def stop(self) -> None: shutil.rmtree(self._data_dir, ignore_errors=True) def create_queue(self, name: str) -> None: - """Create a queue on the test server via FIBP admin op.""" + """Create a queue on the test server via FIBP admin op (binary encoding).""" from fila.fibp import ( OP_CREATE_QUEUE, FibpConnection, - encode_admin, + _encode_frame, make_ssl_context, parse_addr, ) @@ -196,11 +196,18 @@ def create_queue(self, name: str) -> None: conn = FibpConnection(host, port, ssl_ctx=ssl_ctx, api_key=self.api_key) try: corr_id = conn.alloc_corr_id() - proto_body = admin_pb2.CreateQueueRequest( - name=name, - config=admin_pb2.QueueConfig(), - ).SerializeToString() - frame = encode_admin(OP_CREATE_QUEUE, corr_id, proto_body) + # Binary wire format: queue_len:u16 + queue:utf8 + # + on_enqueue_len:u16 + on_enqueue:utf8 + # + on_failure_len:u16 + on_failure:utf8 + # + visibility_timeout_ms:u32 + name_b = name.encode() + body = ( + struct.pack(">H", len(name_b)) + name_b + + struct.pack(">H", 0) # on_enqueue: empty + + struct.pack(">H", 0) # on_failure: empty + + struct.pack(">I", 0) # visibility_timeout_ms: 0 + ) + frame = _encode_frame(0, OP_CREATE_QUEUE, corr_id, body) fut = conn.send_request(frame, corr_id) fut.result(timeout=10.0) finally: