From c7da61b5ad6600b69490f424036d5793bed96888 Mon Sep 17 00:00:00 2001 From: Rohan Singh Date: Sun, 19 May 2024 20:02:16 -0400 Subject: [PATCH] Add WithThreadInitializer for custom initializers --- runtime/applet.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/runtime/applet.go b/runtime/applet.go index 9ba34a0504..507278117c 100644 --- a/runtime/applet.go +++ b/runtime/applet.go @@ -77,6 +77,13 @@ func WithModuleLoader(loader ModuleLoader) AppletOption { } } +func WithThreadInitializer(init ThreadInitializer) AppletOption { + return func(a *Applet) error { + a.initializers = append(a.initializers, init) + return nil + } +} + func WithSecretDecryptionKey(key *SecretDecryptionKey) AppletOption { return func(a *Applet) error { if decrypter, err := key.decrypterForApp(a); err != nil {