Skip to content

Commit

Permalink
Completely remove experimental GRPC module
Browse files Browse the repository at this point in the history
  • Loading branch information
olegbespalov committed Jan 11, 2024
1 parent 033d768 commit 44bbbd4
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 21 deletions.
1 change: 0 additions & 1 deletion js/jsmodules.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ func getInternalJSModules() map[string]interface{} {
"k6/experimental/redis": redis.New(),
"k6/experimental/webcrypto": webcrypto.New(),
"k6/experimental/websockets": &expws.RootModule{},
"k6/experimental/grpc": grpc.NewExperimental(),
"k6/experimental/timers": timers.New(),
"k6/experimental/tracing": tracing.New(),
"k6/experimental/browser": browser.New(),
Expand Down
21 changes: 1 addition & 20 deletions js/modules/k6/grpc/grpc.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ package grpc
import (
"errors"
"fmt"
"sync"

"github.com/dop251/goja"
"github.com/mstoykov/k6-taskqueue-lib/taskqueue"
Expand All @@ -16,9 +15,7 @@ import (
type (
// RootModule is the global module instance that will create module
// instances for each VU.
RootModule struct {
warnAboutExperimental *sync.Once
}
RootModule struct{}

// ModuleInstance represents an instance of the GRPC module for every VU.
ModuleInstance struct {
Expand All @@ -38,13 +35,6 @@ func New() *RootModule {
return &RootModule{}
}

// NewExperimental returns a pointer to a new RootModule instance.
func NewExperimental() *RootModule {
return &RootModule{
warnAboutExperimental: &sync.Once{},
}
}

// NewModuleInstance implements the modules.Module interface to return
// a new instance for each VU.
func (r *RootModule) NewModuleInstance(vu modules.VU) modules.Instance {
Expand All @@ -53,15 +43,6 @@ func (r *RootModule) NewModuleInstance(vu modules.VU) modules.Instance {
common.Throw(vu.Runtime(), fmt.Errorf("failed to register GRPC module metrics: %w", err))
}

if r.warnAboutExperimental != nil {
r.warnAboutExperimental.Do(func() {
vu.InitEnv().Logger.Warn(
"k6/experimental/grpc is now part of the k6 core, please change your imports to use k6/net/grpc instead." +
" The k6/experimental/grpc will be removed in k6 v0.51.0",
)
})
}

mi := &ModuleInstance{
vu: vu,
exports: make(map[string]interface{}),
Expand Down

0 comments on commit 44bbbd4

Please sign in to comment.