File tree Expand file tree Collapse file tree 1 file changed +37
-0
lines changed Expand file tree Collapse file tree 1 file changed +37
-0
lines changed Original file line number Diff line number Diff line change @@ -579,3 +579,40 @@ func getDBOSVersion() string {
579579 }
580580 return "unknown"
581581}
582+
583+ // Launch launches the DBOS runtime using the provided DBOSContext.
584+ // This is a package-level wrapper for the DBOSContext.Launch() method.
585+ //
586+ // Example:
587+ //
588+ // ctx, err := dbos.NewDBOSContext(context.Background(), config)
589+ // if err != nil {
590+ // log.Fatal(err)
591+ // }
592+ //
593+ // if err := dbos.Launch(ctx); err != nil {
594+ // log.Fatal(err)
595+ // }
596+ func Launch (ctx DBOSContext ) error {
597+ if ctx == nil {
598+ return fmt .Errorf ("ctx cannot be nil" )
599+ }
600+ return ctx .Launch ()
601+ }
602+
603+ // Shutdown gracefully shuts down the DBOS runtime using the provided DBOSContext and timeout.
604+ // This is a package-level wrapper for the DBOSContext.Shutdown() method.
605+ //
606+ // Example:
607+ //
608+ // ctx, err := dbos.NewDBOSContext(context.Background(), config)
609+ // if err != nil {
610+ // log.Fatal(err)
611+ // }
612+ // defer dbos.Shutdown(ctx, 30*time.Second)
613+ func Shutdown (ctx DBOSContext , timeout time.Duration ) {
614+ if ctx == nil {
615+ return
616+ }
617+ ctx .Shutdown (timeout )
618+ }
You can’t perform that action at this time.
0 commit comments