Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AsyncEventForwarder ¶
type AsyncEventForwarder struct {
// contains filtered or unexported fields
}
AsyncEventForwarder provides the ability to asynchronously process testing events. It can be used by users to make their own TestingEventListers asynchronous and prevent them from stalling the TestingBatch's event loop.
func NewAsyncEventForwarder ¶
func NewAsyncEventForwarder(receiver scold.TestingEventListener, queueSize int, args ...util.WaitGroup) *AsyncEventForwarder
NewAsyncEventForwarder will create an instance of AsyncEventForwarder that will forward events to the receiver. The internal queue will be of size queueSize. If the receiver cannot process events fast enough and queueSize is quite small, the AsyncEventForwarder will stall TestingBatch.
Additional struct implementing util.WaitGroup can be also passed. It will be used instead of sync.WaitGroup.
func (*AsyncEventForwarder) SuiteFinished ¶
func (f *AsyncEventForwarder) SuiteFinished(b *scold.TestingBatch)
SuiteFinished pushes event to the internal queue, closes it and exits immediately.
func (*AsyncEventForwarder) TestFinished ¶
func (f *AsyncEventForwarder) TestFinished(test *scold.Test, result *scold.TestResult)
TestFinished pushes event to the internal queue and exits immediately.
func (*AsyncEventForwarder) TestStarted ¶
func (f *AsyncEventForwarder) TestStarted(id int)
TestStarted pushes event to the internal queue and exits immediately.
func (*AsyncEventForwarder) Wait ¶
func (f *AsyncEventForwarder) Wait()
Wait will block until all events have been processed.