Expose HasModuleInstancePerVU
interface to external consumers
#1909
Labels
HasModuleInstancePerVU
interface to external consumers
#1909
Expose
HasModuleInstancePerVU
to external consumers.Feature Description
Currently, the
HasModuleInstancePerVU
interface is placed in an internal folder. This has the drawback that you can't check explicitly that an xk6 module implements it using the famous oldvar _ module.HasModuleInstancePerVU = new(Whatever)
method. This might lead to extensions drifting away from the interface over time, without noticing, as this will only be checked at runtime.https://github.com/loadimpact/k6/blob/67e33ab75d6a94659792ecf31afa7dd69e87c825/js/internal/modules/modules.go#L45-L50
Suggested Solution (optional)
While it is possible to redefine the interface in your xk6 package, or just skip the check and implement
NewModuleInstancePerVU()
anyway, it makes the xk6 extension unnecessarily fragile. Instead, I suggest we expose it by moving it outside theinternal
folder.The text was updated successfully, but these errors were encountered: