You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: web_handler.go
    path of file: ./repos/ergo/gen
    
    the code of the file until where you have to start completion: package gen

import (
	"fmt"
	"net/http"
	"reflect"
	"strconv"
	"sync"
	"sync/atomic"
	"time"
	"unsafe"

	"github.com/ergo-services/ergo/etf"
	"github.com/ergo-services/ergo/lib"
)

var (
	WebHandlerStatusDone WebHandlerStatus = nil
	WebHandlerStatusWait WebHandlerStatus = fmt.Errorf("wait")

	defaultRequestQueueLength = 10

	webMessageRequestPool = &sync.Pool{
		New: func() interface{} {
			return &webMessageRequest{}
		},
	}
)

type WebHandlerStatus error

type WebHandlerBehavior interface {
	ServerBehavior

	// Mandatory callback
	HandleRequest(process *WebHandlerProcess, request WebMessageRequest) WebHandlerStatus

	// Optional callbacks
	HandleWebHandlerCall(process *WebHandlerProcess, from ServerFrom
    
func (wh *WebHandler) initHandler(parent Process, handler WebHandlerBehavior, options WebHandlerOptions) (http.Handler, error) {
	if options.NumHandlers < 1 {
		options.NumHandlers = 1
	}
	if options.RequestTimeout < 1 {
		options.RequestTimeout = DefaultCallTimeout
	}

	if options.IdleTimeout < 0 {
		options.IdleTimeout = 0
	}

	if options.RequestQueueLength < 1 {
		options.RequestQueueLength = defaultRequestQueueLength
	}

	wh.parent = parent
	wh.behavior = handler
	wh.options = options
	c := atomic.AddUint64(&wh.counter, 1)
	if c > 1 {
		return nil, fmt.Errorf("you can not use the same object more than once")
	}

	for i := 0; i < options.NumHandlers; i++ {
		p := wh.startHandler(i, options.IdleTimeout)
		if p == nil {
			return nil, fmt.Errorf("can not initialize handlers")
		}
		wh.pool = append(wh.pool, &p)
	}
	return wh, nil
}