func (o ObservableInt) ToSingle() (entry int, err error) {
	o = o.Single()
	subscriber := subscriber.New()
	scheduler := scheduler.MakeTrampoline()
	observer := func(next int, err error, done bool) {
		if !done {
			entry = next
		} else {
			subscriber.Done(err)
		}
	}
	subscriber.OnWait(scheduler.Wait)
	o(observer, scheduler, subscriber)
	err = subscriber.Wait()
	return
}
jig:name ObservableInt_ToSingle
ToSingle blocks until the ObservableInt emits exactly one value or an error.
The value and any error are returned.
ToSingle uses a trampoline scheduler created with scheduler.MakeTrampoline().
package Count
import (
	"fmt"
	"github.com/reactivego/scheduler"
	"github.com/reactivego/subscriber"
)
type Scheduler = scheduler.Scheduler
type Subscriber = subscriber.Subscriber
type IntObserver func(next int, err error, done bool)
type ObservableInt func(IntObserver, Scheduler, Subscriber)
func FromInt(slice ...int) ObservableInt {
	observable := func(observe IntObserver, scheduler Scheduler, subscriber Subscriber) {
		i := 0
		runner := scheduler.ScheduleRecursive(func(self func()) {
			if subscriber.Subscribed() {
				if i < len(slice) {
					observe(slice[i], nil, false)
					if subscriber.Subscribed() {
						i++
						self()
					}
				} else {
					var zero int
					observe(zero, nil, true)
				}
			}
		})
		subscriber.OnUnsubscribe(runner.Cancel)
	}
	return observable
}
func (o ObservableInt) Count() ObservableInt {
	observable := func(observe IntObserver, subscribeOn Scheduler, subscriber Subscriber) {
		var count int
		observer := func(next int, err error, done bool) {
			if !done {
				count++
			} else {
				observe(count, nil, false)
				observe(0, err, done)
			}
		}
		o(observer, subscribeOn, subscriber)
	}
	return observable
}
func (o ObservableInt) Println(a ...interface{}) error {
	subscriber := subscriber.New()
	scheduler := scheduler.MakeTrampoline()
	observer := func(next int, err error, done bool) {
		if !done {
			fmt.Println(append(a, next)...)
		} else {
			subscriber.Done(err)
		}
	}
	subscriber.OnWait(scheduler.Wait)
	o(observer, scheduler, subscriber)
	return subscriber.Wait()
}