Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(runner): expose the method process #700

Merged
merged 1 commit into from
Jul 21, 2022

Conversation

akkuman
Copy link
Contributor

@akkuman akkuman commented Jul 18, 2022

expose the mothod process to support the pipeline pattern, like https://go.dev/blog/pipelines

this is a example:

func run(inCh chan string) (outCh chan runner.Result) {
	threadCount := 50
	opt := &runner.Options{
		Methods: "GET",
		Threads: threadCount,
	}
	rr, err := runner.New(opt)
	if err != nil {
		panic(err)
	}
	wg := sizedwaitgroup.New(threadCount)
	scanopts := rr.GetScanOpts()
	outCh = make(chan runner.Result, 1000)
	go func() {
		defer close(outCh)
		for target := range inCh {
			rr.Process(target, &wg, httpx.HTTPorHTTPS, &scanopts, outCh)
		}
		wg.Wait()
	}()
	return outCh
}

to support the pipeline pattern
@ehsandeep ehsandeep requested a review from Mzack9999 July 20, 2022 11:47
@Mzack9999 Mzack9999 changed the title feat(runner): expose the mothod process feat(runner): expose the method process Jul 21, 2022
@ehsandeep ehsandeep merged commit 8f3ab27 into projectdiscovery:dev Jul 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants