slim-bindings 0.4.0__cp313-cp313-win_amd64.whl → 0.5.0__cp313-cp313-win_amd64.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 slim-bindings might be problematic. Click here for more details.
- slim_bindings/__init__.py +16 -4
- slim_bindings/_slim_bindings.cp313-win_amd64.pyd +0 -0
- slim_bindings/_slim_bindings.pyi +6 -1
- {slim_bindings-0.4.0.dist-info → slim_bindings-0.5.0.dist-info}/METADATA +6 -6
- slim_bindings-0.5.0.dist-info/RECORD +6 -0
- {slim_bindings-0.4.0.dist-info → slim_bindings-0.5.0.dist-info}/WHEEL +1 -1
- slim_bindings-0.4.0.dist-info/RECORD +0 -6
slim_bindings/__init__.py
CHANGED
|
@@ -510,6 +510,8 @@ class Slim:
|
|
|
510
510
|
session: PySessionInfo,
|
|
511
511
|
msg: bytes,
|
|
512
512
|
dest: PyName,
|
|
513
|
+
payload_type: Optional[str] = None,
|
|
514
|
+
metadata: Optional[dict] = None,
|
|
513
515
|
):
|
|
514
516
|
"""
|
|
515
517
|
Publish a message to an app or channel via normal matching in subscription table.
|
|
@@ -518,6 +520,8 @@ class Slim:
|
|
|
518
520
|
session (PySessionInfo): The session information.
|
|
519
521
|
msg (str): The message to publish.
|
|
520
522
|
dest (PyName): The destination name to publish the message to.
|
|
523
|
+
payload_type (str): The type of the message payload (optional)
|
|
524
|
+
metadata (dict): The metadata associated to the message (optional)
|
|
521
525
|
|
|
522
526
|
Returns:
|
|
523
527
|
None
|
|
@@ -527,7 +531,7 @@ class Slim:
|
|
|
527
531
|
if session.id not in self.sessions:
|
|
528
532
|
raise Exception("session not found", session.id)
|
|
529
533
|
|
|
530
|
-
await publish(self.svc, session, 1, msg, dest)
|
|
534
|
+
await publish(self.svc, session, 1, msg, dest, payload_type, metadata)
|
|
531
535
|
|
|
532
536
|
async def invite(
|
|
533
537
|
self,
|
|
@@ -575,7 +579,13 @@ class Slim:
|
|
|
575
579
|
|
|
576
580
|
return session_info, message
|
|
577
581
|
|
|
578
|
-
async def publish_to(
|
|
582
|
+
async def publish_to(
|
|
583
|
+
self,
|
|
584
|
+
session: PySessionInfo,
|
|
585
|
+
msg: bytes,
|
|
586
|
+
payload_type: Optional[str] = None,
|
|
587
|
+
metadata: Optional[dict] = None,
|
|
588
|
+
):
|
|
579
589
|
"""
|
|
580
590
|
Publish a message back to the application that sent it.
|
|
581
591
|
The information regarding the source app is stored in the session.
|
|
@@ -588,7 +598,9 @@ class Slim:
|
|
|
588
598
|
None
|
|
589
599
|
"""
|
|
590
600
|
|
|
591
|
-
await publish(
|
|
601
|
+
await publish(
|
|
602
|
+
self.svc, session, 1, msg, payload_type=payload_type, metadata=metadata
|
|
603
|
+
)
|
|
592
604
|
|
|
593
605
|
async def receive(
|
|
594
606
|
self, session: Optional[int] = None
|
|
@@ -615,7 +627,7 @@ class Slim:
|
|
|
615
627
|
else:
|
|
616
628
|
# Check if the session ID is in the sessions map
|
|
617
629
|
if session not in self.sessions:
|
|
618
|
-
raise Exception("Session ID not found")
|
|
630
|
+
raise Exception(f"Session ID not found: {session}")
|
|
619
631
|
|
|
620
632
|
# Get the queue for the session
|
|
621
633
|
queue = self.sessions[session][1]
|
|
Binary file
|
slim_bindings/_slim_bindings.pyi
CHANGED
|
@@ -23,6 +23,9 @@ class PyName:
|
|
|
23
23
|
def components(self) -> builtins.list[builtins.int]:
|
|
24
24
|
...
|
|
25
25
|
|
|
26
|
+
def components_strings(self) -> builtins.list[builtins.str]:
|
|
27
|
+
...
|
|
28
|
+
|
|
26
29
|
def equal_without_id(self, name:PyName) -> builtins.bool:
|
|
27
30
|
...
|
|
28
31
|
|
|
@@ -41,6 +44,8 @@ class PySessionInfo:
|
|
|
41
44
|
id: builtins.int
|
|
42
45
|
source_name: PyName
|
|
43
46
|
destination_name: PyName
|
|
47
|
+
payload_type: builtins.str
|
|
48
|
+
metadata: builtins.dict[builtins.str, builtins.str]
|
|
44
49
|
def __new__(cls,session_id:builtins.int): ...
|
|
45
50
|
|
|
46
51
|
class PyAlgorithm(Enum):
|
|
@@ -121,7 +126,7 @@ def init_tracing(config:dict) -> typing.Any:
|
|
|
121
126
|
def invite(svc:PyService, session_info:PySessionInfo, name:PyName) -> typing.Any:
|
|
122
127
|
...
|
|
123
128
|
|
|
124
|
-
def publish(svc:PyService, session_info:PySessionInfo, fanout:builtins.int, blob:typing.Sequence[builtins.int], name:typing.Optional[PyName]=None) -> typing.Any:
|
|
129
|
+
def publish(svc:PyService, session_info:PySessionInfo, fanout:builtins.int, blob:typing.Sequence[builtins.int], name:typing.Optional[PyName]=None, payload_type:typing.Optional[builtins.str]=None, metadata:typing.Optional[typing.Mapping[builtins.str, builtins.str]]=None) -> typing.Any:
|
|
125
130
|
...
|
|
126
131
|
|
|
127
132
|
def receive(svc:PyService) -> typing.Any:
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: slim-bindings
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.5.0
|
|
4
4
|
Classifier: Development Status :: 3 - Alpha
|
|
5
5
|
Classifier: Intended Audience :: Developers
|
|
6
6
|
Classifier: Topic :: Software Development :: Libraries
|
|
@@ -10,12 +10,12 @@ Classifier: Programming Language :: Python :: 3.11
|
|
|
10
10
|
Classifier: Programming Language :: Python :: 3.12
|
|
11
11
|
Classifier: Programming Language :: Python :: 3.13
|
|
12
12
|
Summary: SLIM Rust bindings for Python
|
|
13
|
-
License: Apache-2.0
|
|
13
|
+
License-Expression: Apache-2.0
|
|
14
14
|
Requires-Python: >=3.9, <4.0
|
|
15
15
|
Description-Content-Type: text/markdown; charset=UTF-8; variant=GFM
|
|
16
16
|
Project-URL: Repository, https://github.com/agntcy/slim
|
|
17
17
|
Project-URL: Issues, https://github.com/agntcy/slim/issues
|
|
18
|
-
Project-URL: Changelog, https://github.com/agntcy/slim/blob/main/data-plane/python
|
|
18
|
+
Project-URL: Changelog, https://github.com/agntcy/slim/blob/main/data-plane/python/bindings/CHANGELOG.md
|
|
19
19
|
|
|
20
20
|
# SLIM Python Bindings
|
|
21
21
|
|
|
@@ -38,7 +38,7 @@ version = "0.1.0"
|
|
|
38
38
|
description = "Python program using SLIM"
|
|
39
39
|
requires-python = ">=3.9"
|
|
40
40
|
dependencies = [
|
|
41
|
-
"slim-bindings>=0.
|
|
41
|
+
"slim-bindings>=0.5.0"
|
|
42
42
|
]
|
|
43
43
|
```
|
|
44
44
|
|
|
@@ -52,10 +52,10 @@ description = "Python program using SLIM"
|
|
|
52
52
|
|
|
53
53
|
[tool.poetry.dependencies]
|
|
54
54
|
python = ">=3.9,<3.14"
|
|
55
|
-
slim-bindings = ">=0.
|
|
55
|
+
slim-bindings = ">=0.5.0"
|
|
56
56
|
```
|
|
57
57
|
|
|
58
58
|
## Example programs
|
|
59
59
|
|
|
60
|
-
Example apps can be found in the [repo](https://github.com/agntcy/slim/tree/
|
|
60
|
+
Example apps can be found in the [repo](https://github.com/agntcy/slim/tree/slim-v0.5.0/data-plane/python/bindings/examples)
|
|
61
61
|
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
slim_bindings-0.5.0.dist-info/METADATA,sha256=uRIm8DSwy6JKebHed40-v54TE3SATqY-rdxgXDlXSDY,1604
|
|
2
|
+
slim_bindings-0.5.0.dist-info/WHEEL,sha256=K7foeVF-x_RZTycPKa1uE1HH2bAWe3AiJbihrXn5Hhc,96
|
|
3
|
+
slim_bindings/__init__.py,sha256=rbznLnV8PkidmL85t-CjH8goHZdk6u5dSRKQSFfSKyY,21082
|
|
4
|
+
slim_bindings/_slim_bindings.cp313-win_amd64.pyd,sha256=oCCwnZSDCqsJQ1NHCGxXu4mQY5aMdjKMRtyvIWcuLp0,20825600
|
|
5
|
+
slim_bindings/_slim_bindings.pyi,sha256=xtYt9BVXAom8fNOUAwnYhRExECor_7IpRekM1SSwuX4,4166
|
|
6
|
+
slim_bindings-0.5.0.dist-info/RECORD,,
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
slim_bindings-0.4.0.dist-info/METADATA,sha256=hr4h8oq0wGStSM1DxOZMcLgLL0MKsTvoVO-68FLS4Ug,1613
|
|
2
|
-
slim_bindings-0.4.0.dist-info/WHEEL,sha256=oXe_QNnB5QbkkMcbfZh2d88Kje6edNs5JzpWke0-klE,96
|
|
3
|
-
slim_bindings/__init__.py,sha256=Fc4C_14UmMh7QBK6xUWyvhjx1jQuS1qI9gawq81LO54,20589
|
|
4
|
-
slim_bindings/_slim_bindings.cp313-win_amd64.pyd,sha256=mmkEA2yaDCzOVSfqCQ3nzCBS-Y6Zx4O0190dp4hGnp0,20309504
|
|
5
|
-
slim_bindings/_slim_bindings.pyi,sha256=9TAVKmDg8Htq_ml7eeUDpnJPkDMPFfV5e4O7QvdhP9w,3872
|
|
6
|
-
slim_bindings-0.4.0.dist-info/RECORD,,
|