func (t *Trade) Poll() ([]interface{}, error) {
	if t.queuedEvents != nil {
		return t.Events(), nil
	}

	if d := time.Since(t.lastPoll); d < pollTimeout {
		time.Sleep(pollTimeout - d)
	}
	t.lastPoll = time.Now()

	err := t.action(t.api.GetStatus())
	if err != nil {
		return nil, err
	}

	return t.Events(), nil
}
// Returns the next batch of events to process. These can be queued from calls to methods
// like `AddItem` or, if there are no queued events, from a new HTTP request to Steam's API (blocking!).
// If the latter is the case, this method may also sleep before the request
// to conform to the polling interval of the official Steam client.
Returns the next batch of events to process. These can be queued from calls to methods
like `AddItem` or, if there are no queued events, from a new HTTP request to Steam's API (blocking!).
If the latter is the case, this method may also sleep before the request
to conform to the polling interval of the official Steam client.
// Returns the next batch of events to process . These can be queued from calls to methods // like ` AddItem ` or if there are no queued events from a new HTTP request to Steam ' s API ( blocking! ) . // If the latter is the case this method may also sleep before the request // to conform to the polling interval of the official Steam client .
func (t *Trade) Poll() ([]interface{}, error) {
	if t.queuedEvents != nil {
		return t.Events(), nil
	}
	if d := time.Since(t.lastPoll); d < pollTimeout {
		time.Sleep(pollTimeout - d)
	}
	t.lastPoll = time.Now()
	err := t.action(t.api.GetStatus())
	if err != nil {
		return nil, err
	}
	return t.Events(), nil
}
func ( t * Trade ) Poll ( ) ( [ ] interface { } , error ) { if t . queuedEvents != nil { return t . Events ( ) , nil } if d := time . Since ( t . lastPoll ) ; d < pollTimeout { time . Sleep ( pollTimeout - d ) } t . lastPoll = time . Now ( ) err := t . action ( t . api . GetStatus ( ) ) if err != nil { return nil , err } return t . Events ( ) , nil }
Returns the next batch of events to process.
Returns the next batch of events to process .