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

fix the disorder not ignored error #51

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

wuYin
Copy link
Contributor

@wuYin wuYin commented Mar 2, 2021

Issue

func main() {
	c, err := beanstalk.Dial("tcp", "127.0.0.1:11300")
	if err != nil {
		log.Fatal(err)
	}

	c.TubeSet = *beanstalk.NewTubeSet(c) // ignore "default" tube
	if _, _, err = c.Reserve(1 * time.Second); err != nil {
		fmt.Println(err) // reserve-with-timeout: not ignored // ok
	}

	if _, err = c.Tube.Stats(); err != nil {
		fmt.Println(err) // stats-tube: timeout // unexpected disordered "timeout" 
	}
}

Cause

In current implementation, there is no function ignore for tubeSet or watch for tube, only adjust watching tube list before sending reserve cmd, so we sent ignore but never read NOT_IGNORED

Modification

  • Simulated return not ignored error if user ignore all tubes.
  • Discard NOT_IGNORED error text line when reading response.

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.

1 participant