// TryRun get message from parentNode and handle it util there is no more message to come
//  or message handling is blocking
// only one message will be cached
TryRun get message from parentNode and handle it util there is no more message to come
or message handling is blocking
only one message will be cached
// TryRun get message from parentNode and handle it util there is no more message to come // or message handling is blocking // only one message will be cached
func (n *ActorNode) TryRun(ctx context.Context) error {
	processedCount := 0
	for {
		if n.messageStash == nil {
			n.messageStash = n.parentNode.TryGetDataMessage()
		}
		if n.messageStash == nil {
			return nil
		}
		ok, err := n.messageProcessor.TryHandleDataMessage(ctx, *n.messageStash)
		if err != nil {
			return errors.Trace(err)
		}
		if !ok {
			return nil
		}
		n.messageStash = nil
		processedCount++
		if processedCount >= defaultOutputChannelSize {
			return nil
		}
	}
}
func ( n * ActorNode ) TryRun ( ctx context . Context ) error { processedCount := 0 for { if n . messageStash == nil { n . messageStash = n . parentNode . TryGetDataMessage ( ) } if n . messageStash == nil { return nil } ok , err := n . messageProcessor . TryHandleDataMessage ( ctx , * n . messageStash ) if err != nil { return errors . Trace ( err ) } if ! ok { return nil } n . messageStash = nil processedCount ++ if processedCount >= defaultOutputChannelSize { return nil } } }
TryRun get message from parentNode and handle it util there is no more message to come
or message handling is blocking
only one message will be cached
TryRun get message from parentNode and handle it util there is no more message to come or message handling is blocking only one message will be cached
// batch? // process message failed, stop table actor // node is blocked // processed too many messages may consume more than 1 second, // return here to allow actor system poll other tables, and avoid dead loop