func (s *Server) localMemberEvent(me serf.MemberEvent) {
	if !s.IsLeader() {
		return
	}
	isReap := me.EventType() == serf.EventMemberReap
	for _, m := range me.Members {
		if isReap {
			m.Status = StatusReap
		}
		select {
		case s.reconcileCh <- m:
		default:
		}
	}
}
localMemberEvent is used to reconcile Serf events with the strongly
consistent store if we are the current leader
package consul
import (
	"net"
	"strings"
	"github.com/socketplane/socketplane/Godeps/_workspace/src/github.com/hashicorp/serf/serf"
)
const (
	StatusReap = serf.MemberStatus(-1)
	userEventPrefix = "consul:event:"
)
func userEventName(name string) string {
	return userEventPrefix + name
}
func isUserEvent(name string) bool {
	return strings.HasPrefix(name, userEventPrefix)
}
func rawUserEventName(name string) string {
	return strings.TrimPrefix(name, userEventPrefix)
}
func (s *Server) lanEventHandler() {
	for {
		select {
		case e := <-s.eventChLAN:
			switch e.EventType() {
			case serf.EventMemberJoin:
				s.nodeJoin(e.(serf.MemberEvent), false)
				s.localMemberEvent(e.(serf.MemberEvent))
			case serf.EventMemberLeave:
				fallthrough
			case serf.EventMemberFailed:
				s.nodeFailed(e.(serf.MemberEvent), false)
				s.localMemberEvent(e.(serf.MemberEvent))
			case serf.EventMemberReap:
				s.localMemberEvent(e.(serf.MemberEvent))
			case serf.EventUser:
				s.localEvent(e.(serf.UserEvent))
			case serf.EventMemberUpdate:  
			case serf.EventQuery:  
			default:
				s.logger.Printf("[WARN] consul: unhandled LAN Serf Event: %#v", e)
			}
		case <-s.shutdownCh:
			return
		}
	}
}
func (s *Server) wanEventHandler() {
	for {
		select {
		case e := <-s.eventChWAN:
			switch e.EventType() {
			case serf.EventMemberJoin:
				s.nodeJoin(e.(serf.MemberEvent), true)
			case serf.EventMemberLeave:
				fallthrough
			case serf.EventMemberFailed:
				s.nodeFailed(e.(serf.MemberEvent), true)
			case serf.EventMemberUpdate:  
			case serf.EventMemberReap:  
			case serf.EventUser:
			case serf.EventQuery:  
			default:
				s.logger.Printf("[WARN] consul: unhandled WAN Serf Event: %#v", e)
			}
		case <-s.shutdownCh:
			return
		}
	}
}