func FromChan(ch <-chan *executor.Call) RequestStreamingFunc {
	if ch == nil {
		return func() *executor.Call { return nil }
	}
	return func() *executor.Call {
		if m, ok := <-ch; ok {
			return m
		}
		return nil
	}
}
FromChan returns a streaming request that fetches calls from the given channel until it closes.
If a nil chan is specified then the returned func will always generate nil.
package calls
import (
	"context"
	"github.com/mesos/mesos-go/api/v1/lib"
	"github.com/mesos/mesos-go/api/v1/lib/encoding"
	"github.com/mesos/mesos-go/api/v1/lib/executor"
)
type (
	Request interface {
		Call() *executor.Call
	}
	RequestFunc func() *executor.Call
	RequestStreaming interface {
		Request
		IsStreaming()
	}
	RequestStreamingFunc func() *executor.Call
	Sender interface {
		Send(context.Context, Request) (mesos.Response, error)
	}
	SenderFunc func(context.Context, Request) (mesos.Response, error)
)
func (f RequestFunc) Call() *executor.Call { return f() }
func (f RequestFunc) Marshaler() encoding.Marshaler {
	if call := f(); call != nil {
		return call
	}
	return nil
}
func (f RequestStreamingFunc) Push(c ...*executor.Call) RequestStreamingFunc { return Push(f, c...) }
func (f RequestStreamingFunc) Marshaler() encoding.Marshaler {
	if call := f(); call != nil {
		return call
	}
	return nil
}
func (f RequestStreamingFunc) IsStreaming() {}
func (f RequestStreamingFunc) Call() *executor.Call { return f() }
func Push(r RequestStreaming, c ...*executor.Call) RequestStreamingFunc {
	return func() *executor.Call {
		if len(c) == 0 {
			return r.Call()
		}
		head := c[0]
		c = c[1:]
		return head
	}
}
func Empty() RequestStreamingFunc { return func() *executor.Call { return nil } }
var (
	_ = Request(RequestFunc(nil))
	_ = RequestStreaming(RequestStreamingFunc(nil))
	_ = Sender(SenderFunc(nil))
)
func NonStreaming(c *executor.Call) RequestFunc { return func() *executor.Call { return c } }