RE: Executing Groovy DSL scripts concurrently

2018-02-13 Thread Korbee Reinout
com] Sent: Tuesday, February 13, 2018 3:41 AM To: users@groovy.apache.org Subject: Re: Executing Groovy DSL scripts concurrently That guide to integrating is *very* interesting! I had never seen GroovyClassLoader before. I work with a large application that uses GroovyShell a lot. It has thousan

Re: Executing Groovy DSL scripts concurrently

2018-02-12 Thread Ralph Johnson
That guide to integrating is *very* interesting! I had never seen GroovyClassLoader before. I work with a large application that uses GroovyShell a lot. It has thousands of scripts. Sometimes they call each other recursively, which runs into the same problem with shared Bindings that

RE: Executing Groovy DSL scripts concurrently

2018-02-12 Thread Korbee Reinout
Hi, According to: http://docs.groovy-lang.org/latest/html/documentation/guide-integrating.html “You must be very careful when using shared data in a multithreaded environment. The Binding instance that you pass to GroovyShell is not thread safe, and shared by all scripts.” There are some

Re: Executing Groovy DSL scripts concurrently

2018-02-07 Thread Daniel Sun
Hi Adithyan, How about caching the class instance and reuse it? Here are some scratch code for your reference: ``` static LRUCache lruCache = new LRUCache(100); def dslSrc = ''' your DSL source code ''' def md5 = md5(dslSrc) def resultClass =