func (s *GnatsdTestSuite) TestPubSub() { jobUUID := queue.UUID() w := make(chan bool) processor := func(q queue.Connection, d db.Connection, m *queue.Message) { assert.Equal(s.T(), "http://example.com", m.URL) assert.Equal(s.T(), jobUUID, m.JobUUID) assert.Equal(s.T(), 0, m.Depth) w <- true } s.conn.Subscribe(processor) s.conn.Publish(jobUUID, "http://example.com", 0) <-w }
func (s *RiakTestSuite) SetupTest() { s.jobUUID = queue.UUID() err := s.conn.CreateJob(s.jobUUID) assert.NoError(s.T(), err) }
func (s *Server) createNewJob() (string, error) { jobUUID := queue.UUID() return jobUUID, s.context.Db.CreateJob(jobUUID) }