Skip to content

Commit

Permalink
wip v2 experimentation
Browse files Browse the repository at this point in the history
  • Loading branch information
steinwaywhw committed Sep 10, 2024
1 parent 008e210 commit 1fde9d6
Show file tree
Hide file tree
Showing 10 changed files with 560 additions and 404 deletions.
Empty file added hatchet_sdk/runtime/__init__.py
Empty file.
20 changes: 20 additions & 0 deletions hatchet_sdk/runtime/admin.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@

# import hatchet_sdk.v2.callable as sdk
# import hatchet_sdk.clients.admin as client

# from hatchet_sdk.contracts.workflows_pb2 import (
# CreateStepRateLimit,
# CreateWorkflowJobOpts,
# CreateWorkflowStepOpts,
# CreateWorkflowVersionOpts,
# DesiredWorkerLabels,
# StickyStrategy,
# WorkflowConcurrencyOpts,
# WorkflowKind,
# )

# async def put_workflow(callable: sdk.HatchetCallable, client: client.AdminClient):
# options = callable._.options

# kind: WorkflowKind = WorkflowKind.DURABLE if options.durable else WorkflowKind.FUNCTION

19 changes: 19 additions & 0 deletions hatchet_sdk/runtime/registry.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
from typing import Dict, List


class ActionRegistry:

_registry: Dict[str, "HatchetCallable"] = dict()

def register(self, callable: "HatchetCallable") -> str:
key = "{namespace}:{name}".format(
namespace=callable._.namespace, name=callable._.name
)
self._registry[key] = callable
return key

def list(self) -> List[str]:
return list(self._registry.keys())


global_registry = ActionRegistry()
Loading

0 comments on commit 1fde9d6

Please sign in to comment.