Skip to content

TweetStream.handle() enters a busyloop on stream EOF/error #169

@imax9000

Description

@imax9000
	for {
		select {
		case <-ts.close:
			return
		case <-timer.C:
			ts.heartbeat(false)
		default:
		}

		if !scanner.Scan() {
			continue
		}

https://github.com/g8rswimmer/go-twitter/blob/master/v2/tweet_stream.go#L284

Once scanner.Scan() returns false, it will do so on every subsequent call as well, so if ts.close isn't triggered in the select statement - this loop will just keep spinning without doing anything useful. I don't know the rest of the code well enough to decide what should be done instead of continue here

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions