ironflock 1.0.6__py3-none-any.whl → 1.0.8__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.
ironflock/__init__.py CHANGED
@@ -7,4 +7,4 @@ from ironflock.ironflock import IronFlock
7
7
 
8
8
  __all__ = ["IronFlock", "create_application_component", "create_application_session"]
9
9
 
10
- __version__ = "1.0.6"
10
+ __version__ = "1.0.8"
ironflock/ironflock.py CHANGED
@@ -39,6 +39,7 @@ class IronFlock:
39
39
  self._component = create_application_component(serial_number)
40
40
  self._session: ISession = None
41
41
  self.mainFunc = mainFunc
42
+ self._main_task = None
42
43
 
43
44
  @self._component.on_join
44
45
  async def onJoin(session, details):
@@ -136,13 +137,38 @@ class IronFlock:
136
137
  app_key = os.environ.get("APP_KEY")
137
138
  env_value = os.environ.get("ENV")
138
139
 
139
- topic = f"{swarm_key}.{self._device_key}.{app_key}.{env_value}.{topic}"
140
+ full_topic = f"{swarm_key}.{self._device_key}.{app_key}.{env_value}.{topic}"
140
141
 
141
142
  if self._session is not None:
142
- await self._session.register(topic, func, options=RegisterOptions(force_reregister=True))
143
+ await self._session.register(func, full_topic, options=RegisterOptions(force_reregister=True))
143
144
  else:
144
145
  print("cannot register function, not connected")
145
146
 
147
+ async def call(self, device_key, topic, args, kwargs):
148
+ """Calls a remote procedure on the IronFlock platform.
149
+
150
+ Args:
151
+ device_key (str): The key of the device to call the procedure on.
152
+ topic (str): The URI of the topic to call, e.g. "com.myprocedure".
153
+ args (list): The arguments to pass to the procedure.
154
+ kwargs (dict): The keyword arguments to pass to the procedure.
155
+
156
+ Returns:
157
+ The result of the remote procedure call.
158
+ """
159
+
160
+ swarm_key = os.environ.get("SWARM_KEY")
161
+ app_key = os.environ.get("APP_KEY")
162
+ env_value = os.environ.get("ENV")
163
+
164
+ full_topic = f"{swarm_key}.{device_key}.{app_key}.{env_value}.{topic}"
165
+
166
+ if self._session is not None:
167
+ return await self._session.call(full_topic, *args, **kwargs)
168
+ else:
169
+ print("cannot call, not connected")
170
+ return None
171
+
146
172
  async def publish_to_table(
147
173
  self, tablename: str, *args, **kwargs
148
174
  ) -> Optional[Publication]:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: ironflock
3
- Version: 1.0.6
3
+ Version: 1.0.8
4
4
  Summary: SDK to integrate your IronFlock Industry 4 Apps with the IronFlock Data Infrastructure
5
5
  Home-page: https://github.com/RecordEvolution/ironflock-py
6
6
  Author: Record Evolution GmbH
@@ -84,7 +84,7 @@ pip install --upgrade setuptools wheel twine
84
84
  Build and publish a new pypi package:
85
85
 
86
86
  ```shell
87
- make publish
87
+ just publish
88
88
  ```
89
89
 
90
90
  Check the package at https://pypi.org/project/ironflock/.
@@ -0,0 +1,8 @@
1
+ ironflock/AutobahnConnection.py,sha256=clwEsptqQFjDFn4dUGN4bQyb1cOnPmmNjetfTrRqckY,3687
2
+ ironflock/__init__.py,sha256=Ia3Bb7BjyuGl1YBp3fHz0tHS-CsDtH-JSrjbtl-u7S4,264
3
+ ironflock/ironflock.py,sha256=3OftdBL1Fb4fMKNz3ttnycMAN3GmruIkFkjmKaOzahQ,7867
4
+ ironflock-1.0.8.dist-info/licenses/LICENSE,sha256=GpUKjPB381nmkbBIdX74vxXhsNZaNpngTOciss39Pjk,1073
5
+ ironflock-1.0.8.dist-info/METADATA,sha256=7HJBnHeSatEiEZvFrxn-r6DiI8ORhTd31sK15KkvRDM,2764
6
+ ironflock-1.0.8.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
7
+ ironflock-1.0.8.dist-info/top_level.txt,sha256=hmMdMPJuvnOTlFKYl1XQOn81vg1DE2LT7xrEXgyxcRA,10
8
+ ironflock-1.0.8.dist-info/RECORD,,
@@ -1,8 +0,0 @@
1
- ironflock/AutobahnConnection.py,sha256=clwEsptqQFjDFn4dUGN4bQyb1cOnPmmNjetfTrRqckY,3687
2
- ironflock/__init__.py,sha256=1M027rVxbNQ8Txae1I1ahwEnjHNQYOWALiJsfmUV5_0,264
3
- ironflock/ironflock.py,sha256=V_6uP0jVyuJUKJpAprLvhmQp9iJk2YpR1YWHZ_EnEIY,6871
4
- ironflock-1.0.6.dist-info/licenses/LICENSE,sha256=GpUKjPB381nmkbBIdX74vxXhsNZaNpngTOciss39Pjk,1073
5
- ironflock-1.0.6.dist-info/METADATA,sha256=8lyEFpRQ_DOUDuEXHCBpTT8COjF4Sr-UF4bJMw4_NPE,2764
6
- ironflock-1.0.6.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
7
- ironflock-1.0.6.dist-info/top_level.txt,sha256=hmMdMPJuvnOTlFKYl1XQOn81vg1DE2LT7xrEXgyxcRA,10
8
- ironflock-1.0.6.dist-info/RECORD,,