-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Correctly use context in plugin and provide alternative _WithContext …
…methods This commit ensures that the extism plugin struct does not store a context object in itself as this is not idiomatic Go and leads to unexpected behavior. Instead, a context object is passed to each plugin method call that runs a long running operation. To not break the interface of the SDK, the existing SDK method signatures were preserved, but they were changed to use context.Background under the hood. Next to these, alternative _WithContext methods were added, which allow the caller to provide a custom context object.
- Loading branch information
Showing
4 changed files
with
71 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters