Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/eltorocorp/sfn-poller
An API for setting microservice polling for against AWS SFN workflows.
https://github.com/eltorocorp/sfn-poller
aws poller quoteteam sfn stepfunction stepfunctions
Last synced: about 1 month ago
JSON representation
An API for setting microservice polling for against AWS SFN workflows.
- Host: GitHub
- URL: https://github.com/eltorocorp/sfn-poller
- Owner: eltorocorp
- License: mit
- Created: 2018-05-23T18:49:38.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2018-06-10T07:11:51.000Z (over 6 years ago)
- Last Synced: 2024-06-20T03:42:37.264Z (6 months ago)
- Topics: aws, poller, quoteteam, sfn, stepfunction, stepfunctions
- Language: Go
- Size: 14.6 KB
- Stars: 1
- Watchers: 4
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# sfn-poller
An API for setting up microservice polling against AWS SFN workflows.## example
Setting up a service to poll a state machine for work.```go
import (
"context""github.com/aws/aws-sdk-go/aws/client"
"github.com/aws/aws-sdk-go/aws/session"
"github.com/aws/aws-sdk-go/service/sfn"
"github.com/eltorocorp/sfn-poller/sfnpoller"
"github.com/eltorocorp/sfn-poller/sfnpoller/pollable"
somemicroservice "github.com/coolsoftwareprovider/somerepository"
)func main() {
env := environment.MustGetArgumentsFromEnvVars() // <- basically some method that resolves environment variables into a struct
sfnAPI := sfn.New(getSession())
poller := sfnpoller.
New().
RegisterTask(pollable.NewTask(somemicroservice.Handle, env.ActivityARN, env.WorkerName, env.Timeout, sfnAPI)).
BeginPolling(context.Background())
<-poller.Done()
}func getSession() client.ConfigProvider {
return session.Must(session.NewSessionWithOptions(session.Options{
SharedConfigState: session.SharedConfigEnable,
}))
}```