diff options
| author | Mason Reed <mason@vector35.com> | 2026-03-03 07:57:33 -0800 |
|---|---|---|
| committer | Mason Reed <35282038+emesare@users.noreply.github.com> | 2026-03-24 18:46:48 -0700 |
| commit | 2c358e705bbde855b12780be86ef19501a62dfed (patch) | |
| tree | 4f3012bdf36c9a0f7de4218790e6e1aa389621ba /plugins/warp/api/python | |
| parent | 7877f7caa3535a7c477c911ddeafdf5bb14ebc14 (diff) | |
[WARP] Server-side constraint matching
Reduce networked functions by constraining on the returned set of functions on the server
Diffstat (limited to 'plugins/warp/api/python')
| -rw-r--r-- | plugins/warp/api/python/warp.py | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/plugins/warp/api/python/warp.py b/plugins/warp/api/python/warp.py index a699ebbc..2ba1c681 100644 --- a/plugins/warp/api/python/warp.py +++ b/plugins/warp/api/python/warp.py @@ -426,11 +426,17 @@ class WarpContainer(metaclass=_WarpContainerMetaclass): core_guids[i] = guids[i].uuid return warpcore.BNWARPContainerRemoveTypes(self.handle, source.uuid, core_guids, count) - def fetch_functions(self, target: WarpTarget, guids: List[FunctionGUID], source_tags: Optional[List[str]] = None): + def fetch_functions(self, target: WarpTarget, guids: List[FunctionGUID], source_tags: Optional[List[str]] = None, constraints: Optional[List[ConstraintGUID]] = None): count = len(guids) core_guids = (warpcore.BNWARPFunctionGUID * count)() for i in range(count): core_guids[i] = guids[i].uuid + if constraints is None: + constraints = [] + constraints_count = len(constraints) + core_constraints = (warpcore.BNWARPConstraintGUID * constraints_count)() + for i in range(constraints_count): + core_constraints[i] = constraints[i].uuid if source_tags is None: source_tags = [] source_tags_ptr = (ctypes.c_char_p * len(source_tags))() @@ -438,7 +444,7 @@ class WarpContainer(metaclass=_WarpContainerMetaclass): for i in range(len(source_tags)): source_tags_ptr[i] = source_tags[i].encode('utf-8') source_tags_array_ptr = ctypes.cast(source_tags_ptr, ctypes.POINTER(ctypes.c_char_p)) - warpcore.BNWARPContainerFetchFunctions(self.handle, target.handle, source_tags_array_ptr, source_tags_len, core_guids, count) + warpcore.BNWARPContainerFetchFunctions(self.handle, target.handle, source_tags_array_ptr, source_tags_len, core_guids, count, core_constraints, constraints_count) def get_sources_with_function_guid(self, target: WarpTarget, guid: FunctionGUID) -> List[Source]: count = ctypes.c_size_t() |
