Skip to content

Commit

Permalink
refactor(breaking): Deprecate sync calls, from now on they will be au…
Browse files Browse the repository at this point in the history
…to generated with DPP_DEPRECATED on them advising users to use coro.
  • Loading branch information
braindigitalis committed Oct 14, 2024
1 parent 6ba5df8 commit 6c7b112
Show file tree
Hide file tree
Showing 2 changed files with 412 additions and 209 deletions.
3 changes: 2 additions & 1 deletion buildtools/classes/Generator/SyncGenerator.php
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ public function checkForChanges(): bool
*/
public function generateHeaderDef(string $returnType, string $currentFunction, string $parameters, string $noDefaults, string $parameterTypes, string $parameterNames): string
{
return "$returnType {$currentFunction}_sync($parameters);\n\n";
return "DPP_DEPRECATED(\"Please use coroutines instead of sync functions: https://dpp.dev/coro-introduction.html\") $returnType {$currentFunction}_sync($parameters);\n\n";
}

/**
Expand All @@ -107,6 +107,7 @@ public function getCommentArray(): array
return [
" * \memberof dpp::cluster",
" * @throw dpp::rest_exception upon failure to execute REST function",
" * @deprecated This function is deprecated, please use coroutines instead.",
" * @warning This function is a blocking (synchronous) call and should only be used from within a separate thread.",
" * Avoid direct use of this function inside an event handler.",
];
Expand Down
Loading

0 comments on commit 6c7b112

Please sign in to comment.