In creating a module to be run in an Electron render thread, I was running into an apparent race condition with creating many pooled instances simultaneously on load (the issue seems similar to that in mapnik/mapnik#1459).
I was able to solve the issue by synchronously loading mapfiles using the map.fromStringSync method. Here, I've added this as an option (disabled by default) for mapnik-pool. I've added some tests and it appears that everything works well. There are no changes to the API except a boolean sync flag in initOptions.
In creating a module to be run in an Electron render thread, I was running into an apparent race condition with creating many pooled instances simultaneously on load (the issue seems similar to that in mapnik/mapnik#1459).
I was able to solve the issue by synchronously loading mapfiles using the
map.fromStringSync
method. Here, I've added this as an option (disabled by default) for mapnik-pool. I've added some tests and it appears that everything works well. There are no changes to the API except a booleansync
flag ininitOptions
.