From 515acac8fde8b117ba6d780abcffec0265129203 Mon Sep 17 00:00:00 2001 From: Rohan Singh Date: Sun, 19 May 2024 20:08:09 -0400 Subject: [PATCH] Add WithThreadInitializer for custom initializers (#1076) --- 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 {