Get current plugin Id from Lua

#1

Hi, is it possible to get the subj using PDK?

Thanks in advance

#2

Hi @Alexander_Altshuler,

I’m curious as to why you would like to access the ID of the plugin being executed. Could you elaborate your problem a little?

Thanks,
Harry

#3

Sorry for later reply.

I see 2 possible use cases:

  • store per-plugin-instance data on module level
  • self-update configuration of the plugin

For both cases IMO I need to know plugins Id in Lua.

Regards,
Alexander

#4

I don’t think this is possible as of today. You could open a feature request if you would like this feature.

#5

You can do this today, but the functionality is not exposed by PDK (although we have plans to do so eventually).

You have to be careful and know what you are doing, or else you are exposing yourself to potential memory leaks (i.e. “non reclaimable references”). Several bundled plugins follow such a pattern, for example:

Which builds and caches per-plugin-configuration (what you refer to as “per-plugin-instance”) state only once, for efficiency purposes: