fred-oss 0.27.0__tar.gz → 0.29.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.
Files changed (79) hide show
  1. {fred_oss-0.27.0/src/main/fred_oss.egg-info → fred_oss-0.29.0}/PKG-INFO +1 -1
  2. {fred_oss-0.27.0 → fred_oss-0.29.0}/src/main/fred/future/impl.py +14 -0
  3. fred_oss-0.29.0/src/main/fred/version +1 -0
  4. {fred_oss-0.27.0 → fred_oss-0.29.0}/src/main/fred/worker/interface.py +16 -3
  5. {fred_oss-0.27.0 → fred_oss-0.29.0/src/main/fred_oss.egg-info}/PKG-INFO +1 -1
  6. fred_oss-0.27.0/src/main/fred/version +0 -1
  7. {fred_oss-0.27.0 → fred_oss-0.29.0}/MANIFEST.in +0 -0
  8. {fred_oss-0.27.0 → fred_oss-0.29.0}/NOTICE.txt +0 -0
  9. {fred_oss-0.27.0 → fred_oss-0.29.0}/README.md +0 -0
  10. {fred_oss-0.27.0 → fred_oss-0.29.0}/requirements.txt +0 -0
  11. {fred_oss-0.27.0 → fred_oss-0.29.0}/setup.cfg +0 -0
  12. {fred_oss-0.27.0 → fred_oss-0.29.0}/setup.py +0 -0
  13. {fred_oss-0.27.0 → fred_oss-0.29.0}/src/main/fred/cli/__init__.py +0 -0
  14. {fred_oss-0.27.0 → fred_oss-0.29.0}/src/main/fred/cli/__main__.py +0 -0
  15. {fred_oss-0.27.0 → fred_oss-0.29.0}/src/main/fred/cli/interface.py +0 -0
  16. {fred_oss-0.27.0 → fred_oss-0.29.0}/src/main/fred/cli/main.py +0 -0
  17. {fred_oss-0.27.0 → fred_oss-0.29.0}/src/main/fred/dao/__init__.py +0 -0
  18. {fred_oss-0.27.0 → fred_oss-0.29.0}/src/main/fred/dao/comp/__init__.py +0 -0
  19. {fred_oss-0.27.0 → fred_oss-0.29.0}/src/main/fred/dao/comp/_keyval.py +0 -0
  20. {fred_oss-0.27.0 → fred_oss-0.29.0}/src/main/fred/dao/comp/_queue.py +0 -0
  21. {fred_oss-0.27.0 → fred_oss-0.29.0}/src/main/fred/dao/comp/catalog.py +0 -0
  22. {fred_oss-0.27.0 → fred_oss-0.29.0}/src/main/fred/dao/comp/interface.py +0 -0
  23. {fred_oss-0.27.0 → fred_oss-0.29.0}/src/main/fred/dao/service/__init__.py +0 -0
  24. {fred_oss-0.27.0 → fred_oss-0.29.0}/src/main/fred/dao/service/_redis.py +0 -0
  25. {fred_oss-0.27.0 → fred_oss-0.29.0}/src/main/fred/dao/service/_stdlib.py +0 -0
  26. {fred_oss-0.27.0 → fred_oss-0.29.0}/src/main/fred/dao/service/catalog.py +0 -0
  27. {fred_oss-0.27.0 → fred_oss-0.29.0}/src/main/fred/dao/service/interface.py +0 -0
  28. {fred_oss-0.27.0 → fred_oss-0.29.0}/src/main/fred/dao/service/utils.py +0 -0
  29. {fred_oss-0.27.0 → fred_oss-0.29.0}/src/main/fred/future/__init__.py +0 -0
  30. {fred_oss-0.27.0 → fred_oss-0.29.0}/src/main/fred/future/callback/__init__.py +0 -0
  31. {fred_oss-0.27.0 → fred_oss-0.29.0}/src/main/fred/future/callback/_function.py +0 -0
  32. {fred_oss-0.27.0 → fred_oss-0.29.0}/src/main/fred/future/callback/catalog.py +0 -0
  33. {fred_oss-0.27.0 → fred_oss-0.29.0}/src/main/fred/future/callback/interface.py +0 -0
  34. {fred_oss-0.27.0 → fred_oss-0.29.0}/src/main/fred/future/result.py +0 -0
  35. {fred_oss-0.27.0 → fred_oss-0.29.0}/src/main/fred/future/settings.py +0 -0
  36. {fred_oss-0.27.0 → fred_oss-0.29.0}/src/main/fred/future/utils.py +0 -0
  37. {fred_oss-0.27.0 → fred_oss-0.29.0}/src/main/fred/integrations/databricks/__init__.py +0 -0
  38. {fred_oss-0.27.0 → fred_oss-0.29.0}/src/main/fred/integrations/databricks/cli_ext.py +0 -0
  39. {fred_oss-0.27.0 → fred_oss-0.29.0}/src/main/fred/integrations/databricks/runtime.py +0 -0
  40. {fred_oss-0.27.0 → fred_oss-0.29.0}/src/main/fred/integrations/databricks/runtimes/__init__.py +0 -0
  41. {fred_oss-0.27.0 → fred_oss-0.29.0}/src/main/fred/integrations/databricks/runtimes/scanner.py +0 -0
  42. {fred_oss-0.27.0 → fred_oss-0.29.0}/src/main/fred/integrations/databricks/runtimes/sync.py +0 -0
  43. {fred_oss-0.27.0 → fred_oss-0.29.0}/src/main/fred/integrations/databricks/wrappers/__init__.py +0 -0
  44. {fred_oss-0.27.0 → fred_oss-0.29.0}/src/main/fred/integrations/databricks/wrappers/dbutils.py +0 -0
  45. {fred_oss-0.27.0 → fred_oss-0.29.0}/src/main/fred/integrations/runpod/__init__.py +0 -0
  46. {fred_oss-0.27.0 → fred_oss-0.29.0}/src/main/fred/integrations/runpod/cli_ext.py +0 -0
  47. {fred_oss-0.27.0 → fred_oss-0.29.0}/src/main/fred/integrations/runpod/helper.py +0 -0
  48. {fred_oss-0.27.0 → fred_oss-0.29.0}/src/main/fred/maturity.py +0 -0
  49. {fred_oss-0.27.0 → fred_oss-0.29.0}/src/main/fred/monad/__init__.py +0 -0
  50. {fred_oss-0.27.0 → fred_oss-0.29.0}/src/main/fred/monad/_either.py +0 -0
  51. {fred_oss-0.27.0 → fred_oss-0.29.0}/src/main/fred/monad/catalog.py +0 -0
  52. {fred_oss-0.27.0 → fred_oss-0.29.0}/src/main/fred/monad/interface.py +0 -0
  53. {fred_oss-0.27.0 → fred_oss-0.29.0}/src/main/fred/settings.py +0 -0
  54. {fred_oss-0.27.0 → fred_oss-0.29.0}/src/main/fred/utils/__init__.py +0 -0
  55. {fred_oss-0.27.0 → fred_oss-0.29.0}/src/main/fred/utils/dateops.py +0 -0
  56. {fred_oss-0.27.0 → fred_oss-0.29.0}/src/main/fred/utils/runtime.py +0 -0
  57. {fred_oss-0.27.0 → fred_oss-0.29.0}/src/main/fred/version.py +0 -0
  58. {fred_oss-0.27.0 → fred_oss-0.29.0}/src/main/fred/worker/__init__.py +0 -0
  59. {fred_oss-0.27.0 → fred_oss-0.29.0}/src/main/fred/worker/runner/__init__.py +0 -0
  60. {fred_oss-0.27.0 → fred_oss-0.29.0}/src/main/fred/worker/runner/client.py +0 -0
  61. {fred_oss-0.27.0 → fred_oss-0.29.0}/src/main/fred/worker/runner/handler.py +0 -0
  62. {fred_oss-0.27.0 → fred_oss-0.29.0}/src/main/fred/worker/runner/info.py +0 -0
  63. {fred_oss-0.27.0 → fred_oss-0.29.0}/src/main/fred/worker/runner/plugins/__init__.py +0 -0
  64. {fred_oss-0.27.0 → fred_oss-0.29.0}/src/main/fred/worker/runner/plugins/_local.py +0 -0
  65. {fred_oss-0.27.0 → fred_oss-0.29.0}/src/main/fred/worker/runner/plugins/catalog.py +0 -0
  66. {fred_oss-0.27.0 → fred_oss-0.29.0}/src/main/fred/worker/runner/plugins/interface.py +0 -0
  67. {fred_oss-0.27.0 → fred_oss-0.29.0}/src/main/fred/worker/runner/rest/__init__.py +0 -0
  68. {fred_oss-0.27.0 → fred_oss-0.29.0}/src/main/fred/worker/runner/rest/cli_ext.py +0 -0
  69. {fred_oss-0.27.0 → fred_oss-0.29.0}/src/main/fred/worker/runner/rest/routers/__init__.py +0 -0
  70. {fred_oss-0.27.0 → fred_oss-0.29.0}/src/main/fred/worker/runner/rest/routers/_runner.py +0 -0
  71. {fred_oss-0.27.0 → fred_oss-0.29.0}/src/main/fred/worker/runner/rest/routers/catalog.py +0 -0
  72. {fred_oss-0.27.0 → fred_oss-0.29.0}/src/main/fred/worker/runner/rest/routers/interface.py +0 -0
  73. {fred_oss-0.27.0 → fred_oss-0.29.0}/src/main/fred/worker/runner/rest/server.py +0 -0
  74. {fred_oss-0.27.0 → fred_oss-0.29.0}/src/main/fred/worker/runner/utils.py +0 -0
  75. {fred_oss-0.27.0 → fred_oss-0.29.0}/src/main/fred_oss.egg-info/SOURCES.txt +0 -0
  76. {fred_oss-0.27.0 → fred_oss-0.29.0}/src/main/fred_oss.egg-info/dependency_links.txt +0 -0
  77. {fred_oss-0.27.0 → fred_oss-0.29.0}/src/main/fred_oss.egg-info/entry_points.txt +0 -0
  78. {fred_oss-0.27.0 → fred_oss-0.29.0}/src/main/fred_oss.egg-info/requires.txt +0 -0
  79. {fred_oss-0.27.0 → fred_oss-0.29.0}/src/main/fred_oss.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: fred-oss
3
- Version: 0.27.0
3
+ Version: 0.29.0
4
4
  Summary: FREDOSS
5
5
  Home-page: https://fred.fahera.mx
6
6
  Author: Fahera Research, Education, and Development
@@ -146,6 +146,20 @@ class Future(MonadInterface[A]):
146
146
  case _:
147
147
  raise TypeError("Unknown FutureResult type")
148
148
 
149
+ def getwhatevernow(self) -> Optional[EitherMonad.Either[A]]:
150
+ """Gets the current result of the future without waiting.
151
+ If the future is not yet completed, returns None.
152
+ If the future is completed, returns the result as an Either monad.
153
+
154
+ Returns:
155
+ Optional[Either[A]]: None if the future is not completed; otherwise, an Either monad containing the result or exception.
156
+ """
157
+ match self._result:
158
+ case FutureDefined(value=value):
159
+ return value
160
+ case _:
161
+ return None
162
+
149
163
  @property
150
164
  def state(self) -> Optional[str]:
151
165
  """Returns the current state of the future as a string.
@@ -0,0 +1 @@
1
+ 0.29.0
@@ -1,7 +1,8 @@
1
1
  import time
2
- from typing import Callable, Optional
2
+ from typing import overload, Callable, Optional
3
3
  from dataclasses import dataclass, field
4
4
 
5
+ from fred.future.impl import Future # Should we make this import lazy?
5
6
  from fred.utils.dateops import datetime_utcnow
6
7
  from fred.settings import (
7
8
  get_environ_variable,
@@ -137,15 +138,27 @@ class HandlerInterface:
137
138
  metadata_serialized = json.dumps(self.metadata, default=str)
138
139
  return json.loads(metadata_serialized)
139
140
 
140
- def run(self, event: dict) -> dict:
141
+ @overload
142
+ def run(self, event: dict, as_future: bool = True) -> Future[dict]:
143
+ ...
144
+
145
+ @overload
146
+ def run(self, event: dict, as_future: bool = False) -> dict:
147
+ ...
148
+
149
+ def run(self, event: dict, as_future: bool = False) -> dict | Future[dict]:
141
150
  """Process an incoming event and return a structured response.
142
151
  The event is expected to be a dictionary with at least an 'id' and 'input' keys.
143
152
  The 'input' key should contain the payload to be processed.
144
153
  Args:
145
154
  event (dict): The incoming event containing 'id' and 'input'.
155
+ as_future (bool): If True, the processing will be done in a Future; otherwise, it will be synchronous.
146
156
  Returns:
147
- dict: A structured response containing the result of processing the event.
157
+ dict | Future[dict]: A structured response containing the result of processing the event.
158
+ If requested as a Future, returns a Future that will resolve to the response dictionary.
148
159
  """
160
+ if as_future:
161
+ return Future(function=lambda: self.run(event=event, as_future=False))
149
162
  # Extract payload and event ID
150
163
  payload = event.get("input", {})
151
164
  job_event_identifier = event.get("id")
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: fred-oss
3
- Version: 0.27.0
3
+ Version: 0.29.0
4
4
  Summary: FREDOSS
5
5
  Home-page: https://fred.fahera.mx
6
6
  Author: Fahera Research, Education, and Development
@@ -1 +0,0 @@
1
- 0.27.0
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes