cengal.parallel_execution.asyncio.efficient_streams.versions.v_0.efficient_streams_base

Module Docstring Docstrings: http://www.python.org/dev/peps/pep-0257/

 1#!/usr/bin/env python
 2# coding=utf-8
 3
 4# Copyright © 2012-2024 ButenkoMS. All rights reserved. Contacts: <gtalk@butenkoms.space>
 5# 
 6# Licensed under the Apache License, Version 2.0 (the "License");
 7# you may not use this file except in compliance with the License.
 8# You may obtain a copy of the License at
 9# 
10#     http://www.apache.org/licenses/LICENSE-2.0
11# 
12# Unless required by applicable law or agreed to in writing, software
13# distributed under the License is distributed on an "AS IS" BASIS,
14# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15# See the License for the specific language governing permissions and
16# limitations under the License.
17
18
19"""
20Module Docstring
21Docstrings: http://www.python.org/dev/peps/pep-0257/
22"""
23
24
25__author__ = "ButenkoMS <gtalk@butenkoms.space>"
26__copyright__ = "Copyright © 2012-2024 ButenkoMS. All rights reserved. Contacts: <gtalk@butenkoms.space>"
27__credits__ = ["ButenkoMS <gtalk@butenkoms.space>", ]
28__license__ = "Apache License, Version 2.0"
29__version__ = "4.4.1"
30__maintainer__ = "ButenkoMS <gtalk@butenkoms.space>"
31__email__ = "gtalk@butenkoms.space"
32# __status__ = "Prototype"
33__status__ = "Development"
34# __status__ = "Production"
35
36
37__all__ = ['StreamType', 'GateSecurityPolicy', 'IOCoreMemoryManagement', 'StreamManagerIOCoreMemoryManagement']
38
39
40from enum import Enum
41from cengal.hardware.info.cpu.versions.v_1 import cpu_info
42from cengal.io.core.memory_management import IOCoreMemoryManagement
43from cengal.code_flow_control.smart_values.versions import ValueExistence
44from typing import Optional
45from .efficient_streams_base_internal import *
46
47
48class StreamType(Enum):
49    general = 0
50    message_based_anonymous = 1
51    message_based_names = 2
52    gate = 3
53
54
55class GateSecurityPolicy(Enum):
56    # gate will allow only or ban selected stream names to conect to this gate
57    allowed = 0
58    disabled = 1
59
60
61class StreamManagerIOCoreMemoryManagement(IOCoreMemoryManagement):
62    def __init__(self):
63        super(StreamManagerIOCoreMemoryManagement, self).__init__()
64
65        self.socket_write_fixed_buffer_size = ValueExistence(True,
66                                                             cpu_info().l2_cache_size_per_virtual_core)
67
68    def link_to(self, parent):
69        super(StreamManagerIOCoreMemoryManagement, self).link_to(parent)
70        try:
71            self.socket_write_fixed_buffer_size = parent.socket_write_fixed_buffer_size
72        except AttributeError:
73            pass
class StreamType(enum.Enum):
49class StreamType(Enum):
50    general = 0
51    message_based_anonymous = 1
52    message_based_names = 2
53    gate = 3

An enumeration.

general = <StreamType.general: 0>
message_based_anonymous = <StreamType.message_based_anonymous: 1>
message_based_names = <StreamType.message_based_names: 2>
gate = <StreamType.gate: 3>
Inherited Members
enum.Enum
name
value
class GateSecurityPolicy(enum.Enum):
56class GateSecurityPolicy(Enum):
57    # gate will allow only or ban selected stream names to conect to this gate
58    allowed = 0
59    disabled = 1

An enumeration.

disabled = <GateSecurityPolicy.disabled: 1>
Inherited Members
enum.Enum
name
value
class IOCoreMemoryManagement:
43class IOCoreMemoryManagement:
44    def __init__(self):
45        self.global__data_size_limit = ValueExistence(True, 2 * 1024**3)
46        self.global__data_full_size = ValueExistence(True, 0)
47        self.global__deletable_data_full_size = ValueExistence(True, 0)
48
49        self.global_other__data_size_limit = ValueExistence(True, 512 * 1024**2)
50        self.global_other__data_full_size = ValueExistence(True, 0)
51        self.global_other__deletable_data_full_size = ValueExistence(True, 0)
52
53        self.global_in__data_size_limit = ValueExistence(True, 512 * 1024**2)
54        self.global_in__data_full_size = ValueExistence(True, 0)
55        self.global_in__deletable_data_full_size = ValueExistence(True, 0)
56
57        self.global_out__data_size_limit = ValueExistence(True, 512 * 1024**2)
58        self.global_out__data_full_size = ValueExistence(True, 0)
59        self.global_out__deletable_data_full_size = ValueExistence(True, 0)
60
61    def link_to(self, parent):
62        self.global__data_size_limit = parent.global__data_size_limit
63        self.global__data_full_size = parent.global__data_full_size
64        self.global__deletable_data_full_size = parent.global__deletable_data_full_size
65
66        self.global_other__data_size_limit = parent.global_other__data_size_limit
67        self.global_other__data_full_size = parent.global_other__data_full_size
68        self.global_other__deletable_data_full_size = parent.global_other__deletable_data_full_size
69
70        self.global_in__data_size_limit = parent.global_in__data_size_limit
71        self.global_in__data_full_size = parent.global_in__data_full_size
72        self.global_in__deletable_data_full_size = parent.global_in__deletable_data_full_size
73
74        self.global_out__data_size_limit = parent.global_out__data_size_limit
75        self.global_out__data_full_size = parent.global_out__data_full_size
76        self.global_out__deletable_data_full_size = parent.global_out__deletable_data_full_size
global__data_size_limit
global__data_full_size
global__deletable_data_full_size
global_other__data_size_limit
global_other__data_full_size
global_other__deletable_data_full_size
global_in__data_size_limit
global_in__data_full_size
global_in__deletable_data_full_size
global_out__data_size_limit
global_out__data_full_size
global_out__deletable_data_full_size
62class StreamManagerIOCoreMemoryManagement(IOCoreMemoryManagement):
63    def __init__(self):
64        super(StreamManagerIOCoreMemoryManagement, self).__init__()
65
66        self.socket_write_fixed_buffer_size = ValueExistence(True,
67                                                             cpu_info().l2_cache_size_per_virtual_core)
68
69    def link_to(self, parent):
70        super(StreamManagerIOCoreMemoryManagement, self).link_to(parent)
71        try:
72            self.socket_write_fixed_buffer_size = parent.socket_write_fixed_buffer_size
73        except AttributeError:
74            pass
socket_write_fixed_buffer_size