I haven't played with the plugin feature yet, but some things stand out to
me about your code and I wonder if it is correct or not.

Is there a difference in using go build vs go run, in the same way as you
can get bad behaviour using go run with more complex apps?

Have you tried moving those plugins to subdirs so that you don't have 3
mains in one location when running go build?

Is it necessary to import the processor and printer libs just so that you
can make specific interface values? If interfaces are satisfied implicitly,
then why can't you just make an instance of your local concrete type
without importing the interfaces? "Impl" should be able to satisfy a
printer or processor without you explicitly importing and declaring it as
one. Unless something is special about plugins?

Justin

On Mon, 7 Nov 2016, 7:18 AM Mateusz Dymiński <dymin...@gmail.com> wrote:

> Does it mean that I can't load the two different plugins ?
>
> I know that I can't load the same plugin twice, but I thought that I can
> load two different plugins.
>
> To be precise I was thinking about the MapReduce implementation where the
> client might build the go program which can be loaded as plugin on the
> workers - similar approach is in Hadoop. My main assumption was that the
> same worker written in go cant load plugins for each MapReduce job. Is it
> possible with current plugin go feature ?
>
>
> W dniu niedziela, 6 listopada 2016 06:57:52 UTC+1 użytkownik Tamás Gulácsi
> napisał:
>
> AFAIK it's a design decision that a plugin cannot be loaded twice.
> Protect it with a sync.Once, if you can't avoid calling the loader twice.
>
> --
> You received this message because you are subscribed to the Google Groups
> "golang-nuts" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to golang-nuts+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to