Skip to content

Commit

Permalink
Add subprocessMain to config
Browse files Browse the repository at this point in the history
  • Loading branch information
Daan-Adrichem committed Aug 11, 2021
1 parent 2d79d07 commit 9ba7721
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
1 change: 1 addition & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,6 @@ func main() {
LogCallback: func(s string) {
fmt.Println("[PDFIUM ERROR]: " + s)
},
SubprocessMain: "./subprocess",
})
}
11 changes: 6 additions & 5 deletions pdfium/pdfium.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,11 @@ type worker struct {
var workerPool *pool.ObjectPool

type Config struct {
MinIdle int
MaxIdle int
MaxTotal int
LogCallback func(string)
MinIdle int
MaxIdle int
MaxTotal int
LogCallback func(string)
SubprocessMain string
}

func InitLibrary(config Config) { // serve one thread that is "native" through cgo
Expand Down Expand Up @@ -56,7 +57,7 @@ func InitLibrary(config Config) { // serve one thread that is "native" through c
newWorker := &worker{}

binPath := "go"
args := []string{"run", "./pkg/internal/subprocess"}
args := []string{"run", config.SubprocessMain}

client := plugin.NewClient(&plugin.ClientConfig{
HandshakeConfig: handshakeConfig,
Expand Down

0 comments on commit 9ba7721

Please sign in to comment.