Exemplo n.º 1
0
		clusterInfo.Members = append(clusterInfo.Members, &yagnats.ConnectionInfo{
			Addr: addr,
		})
	}

	err := natsClient.Connect(clusterInfo)
	Ω(err).ShouldNot(HaveOccurred())

	client = repnatsclient.New(natsClient, timeout)

	if auctioneerMode == "inprocess" {
		communicator = func(auctionRequest types.AuctionRequest) types.AuctionResult {
			return auctioneer.Auction(client, auctionRequest)
		}
	} else if auctioneerMode == "remote" {
		communicator = func(auctionRequest types.AuctionRequest) types.AuctionResult {
			return auctioneer.RemoteAuction(natsClient, auctionRequest)
		}
	} else {
		panic("wat?")
	}
})

var _ = BeforeEach(func() {
	for _, guid := range guids {
		client.Reset(guid)
	}

	util.ResetGuids()
})
Exemplo n.º 2
0
	rules = auctioneer.DefaultRules

	sessionsToTerminate = []*gexec.Session{}

	natsRunner.Start()
	client, guids = buildClient(numReps, repResources)

	if auctioneerMode == InProcess {
		communicator = func(auctionRequest types.AuctionRequest) types.AuctionResult {
			return auctioneer.Auction(client, auctionRequest)
		}
	} else if auctioneerMode == RemoteAuction {
		startAuctioneers(numAuctioneers)
		communicator = func(auctionRequest types.AuctionRequest) types.AuctionResult {
			return auctioneer.RemoteAuction(natsRunner.MessageBus, auctionRequest)
		}
	} else {
		panic("wat?")
	}
})

var _ = BeforeEach(func() {
	for _, guid := range guids {
		client.Reset(guid)
	}

	util.ResetGuids()
})

var _ = AfterSuite(func() {