# Implementing asynchronous signal handling

**URL:** <https://community.temporal.io/t/implementing-asynchronous-signal-handling/7891>\
**Category:** Community Support\
**Tags:** go-sdk, signals\
**Created:** [April 12, 2023, 10:05pm UTC](https://community.temporal.io/t/implementing-asynchronous-signal-handling/7891 "2023-04-12T22:05:46Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![ian.smith](https://avatars.discourse-cdn.com/v4/letter/i/e19adc/32.png) [@ian.smith](https://community.temporal.io/u/ian.smith)\
**Post date:** [April 12, 2023, 10:05pm UTC](https://community.temporal.io/t/implementing-asynchronous-signal-handling/7891/1 "2023-04-12T22:05:46Z")

</div>

Hello!  
I’m looking for more information about how to use signals in my temporal programs. Right now I’m trying to modify [this](https://github.com/temporalio/samples-go/tree/main/expense) example project to allow the workflow to be interrupted by a signal while it is waiting on the API to respond with a “SUCCESS” or “REJECT” response.

I am currently a computer engineering student and intern and my familiarity with signals comes from [Linux/Unix](https://man7.org/linux/man-pages/man7/signal.7.html) signals so there may be some knowledge gaps on my end, but I am hoping to implement signals in an asynchronous manner like said Unix signals.

A couple things that I’ve tried are using a selector to register a handler that is called when the signal is received but I can’t get this to work without blocking with a statement like selector.Select(). After browsing some of the questions on here I’ve seen that using a selector might not be the way to go for me but I’m not sure how to add a handler to a signal without it.

> selector := workflow.NewSelector(ctx)  
> selector.AddReceive(signalChan, func (c workflow.ReceiveChannel, \_ bool){  
> c.Receive(ctx, &signal)  
> fmt.Println(“Workflow was signaled”)  
> })

Using the method above I am able to synchronously use signals but I need to be able to use them asynchronously.

How can I implement and use signals with temporal asynchronously while using the Go-SDK?

Thanks!

---

<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:** [April 13, 2023, 10:44pm UTC](https://community.temporal.io/t/implementing-asynchronous-signal-handling/7891/2 "2023-04-13T22:44:38Z")

</div>

The Go approach is to use goroutines for asynchronous code. See [await-signals](https://github.com/temporalio/samples-go/blob/main/await-signals/await_signals_workflow.go) example.
