# Go SDK - Sequential by ID otherwise in parallel

**URL:** <https://community.temporal.io/t/go-sdk-sequential-by-id-otherwise-in-parallel/1486>\
**Category:** Community Support\
**Tags:** go-sdk\
**Created:** [February 11, 2021, 9:28pm UTC](https://community.temporal.io/t/go-sdk-sequential-by-id-otherwise-in-parallel/1486 "2021-02-11T21:28:02Z")\
**Posts on this page:** 1\
**Showing post:** 5

<div class="post-metadata">

**Author:** ![maxim](https://sea2.discourse-cdn.com/flex016/user_avatar/community.temporal.io/maxim/32/8_2.png) [@maxim](https://community.temporal.io/u/maxim)\
**Post date:** [February 12, 2021, 4:07am UTC](https://community.temporal.io/t/go-sdk-sequential-by-id-otherwise-in-parallel/1486/5 "2021-02-12T04:07:37Z")

</div>

There is no need to use `Selector` if you are reading from a single channel. `Channel.Receive` already blocks if a channel is empty. I would rewrite this code as:

```auto
	signalChan := workflow.GetSignalChannel(ctx, signalName)

	for i := 0; i < CONTINUE_AS_NEW_FREQUENCY; i++ {
		var signalVal string
		signalChan.Receive(ctx, &signalVal)
		workflow.GetLogger(ctx).Info("Received signal!", "signal", signalName, "value", signalVal)
		// PROCESS SIGNAL
	}
	// Drain signal channel asynchronously to avoid signal loss
	for {
		var signalVal string
		ok := signalChan.ReceiveAsync(&signalVal)
		if !ok {
			break;
		}
		workflow.GetLogger(ctx).Info("Received signal!", "signal", signalName, "value", signalVal)
		// PROCESS SIGNAL
	}
	return workflow.NewContinueAsNewError(ctx, WorkflowFn)

```

---

_[View the full topic](https://community.temporal.io/t/go-sdk-sequential-by-id-otherwise-in-parallel/1486)._
