ironflock 1.2.1__tar.gz → 1.3.0__tar.gz

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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: ironflock
3
- Version: 1.2.1
3
+ Version: 1.3.0
4
4
  Summary: IronFlock Python SDK for connecting to the IronFlock Platform
5
5
  License-Expression: MIT
6
6
  License-File: LICENSE
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "ironflock"
3
- version = "1.2.1"
3
+ version = "1.3.0"
4
4
  description = "IronFlock Python SDK for connecting to the IronFlock Platform"
5
5
  authors = [
6
6
  {name = "Marko Petzold, IronFlock GmbH", email = "info@ironflock.com"}
@@ -7,4 +7,4 @@ __all__ = [
7
7
  "Stage"
8
8
  ]
9
9
 
10
- __version__ = "1.2.0"
10
+ __version__ = "1.3.0"
@@ -160,7 +160,7 @@ class IronFlock:
160
160
  print(f"Set location failed: {e}")
161
161
  return None
162
162
 
163
- async def register(self, topic: str, endpoint, options: Optional[dict] = None) -> Optional[Any]:
163
+ async def register_function(self, topic: str, endpoint, options: Optional[dict] = None) -> Optional[Any]:
164
164
  """Registers a function with the IronFlock Platform Message Router
165
165
 
166
166
  Args:
@@ -185,6 +185,10 @@ class IronFlock:
185
185
  print(f"Register failed: {e}")
186
186
  return None
187
187
 
188
+ async def register(self, topic: str, endpoint, options: Optional[dict] = None) -> Optional[Any]:
189
+ """Alias for register_function() for backward compatibility"""
190
+ return await self.register_function(topic, endpoint, options)
191
+
188
192
  async def subscribe(self, topic: str, handler, options: Optional[dict] = None) -> Optional[Any]:
189
193
  """Subscribes to a topic on the IronFlock Platform Message Router
190
194
 
@@ -302,7 +306,11 @@ class IronFlock:
302
306
  if self._connection:
303
307
  await self._connection.stop()
304
308
 
305
- async def run(self):
309
+ def run(self):
310
+ """Synchronous wrapper to run the IronFlock instance (original API)"""
311
+ asyncio.run(self.run_async())
312
+
313
+ async def run_async(self):
306
314
  """Start the connection and keep it running"""
307
315
  await self.start()
308
316
 
@@ -323,5 +331,5 @@ class IronFlock:
323
331
  await self.stop()
324
332
 
325
333
  def run_sync(self):
326
- """Synchronous wrapper to run the IronFlock instance (for backward compatibility)"""
327
- asyncio.run(self.run())
334
+ """Alias for run() method for clarity"""
335
+ return self.run()
File without changes
File without changes