blob: 35c955a450f951d6169f842ee62b6ff732cdcb70 [file] [log] [blame]
package profiles
import (
"v.io/core/veyron2"
"v.io/core/veyron2/context"
"v.io/core/veyron/lib/appcycle"
_ "v.io/core/veyron/runtimes/google/ipc/protocols/tcp"
_ "v.io/core/veyron/runtimes/google/ipc/protocols/ws"
_ "v.io/core/veyron/runtimes/google/ipc/protocols/wsh"
grt "v.io/core/veyron/runtimes/google/rt"
)
func init() {
veyron2.RegisterProfileInit(Init)
}
func Init(ctx *context.T) (veyron2.RuntimeX, *context.T, veyron2.Shutdown, error) {
runtime := &grt.RuntimeX{}
ctx, shutdown, err := runtime.Init(ctx, nil)
if err != nil {
return nil, nil, nil, err
}
ac := appcycle.New()
ctx = runtime.SetAppCycle(ctx, ac)
profileShutdown := func() {
shutdown()
ac.Shutdown()
}
return runtime, ctx, profileShutdown, nil
}