{"id":13413026,"url":"https://github.com/studiosol/async","last_synced_at":"2026-03-17T22:13:52.264Z","repository":{"id":48171883,"uuid":"95908667","full_name":"StudioSol/async","owner":"StudioSol","description":"A safe way to execute functions asynchronously, recovering them in case of panic. It also provides an error stack aiming to facilitate fail causes discovery.","archived":false,"fork":false,"pushed_at":"2020-11-19T17:27:17.000Z","size":26,"stargazers_count":135,"open_issues_count":2,"forks_count":18,"subscribers_count":11,"default_branch":"master","last_synced_at":"2024-08-02T01:25:24.395Z","etag":null,"topics":["async","go","hacktoberfest"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/StudioSol.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-06-30T17:08:33.000Z","updated_at":"2024-06-01T00:21:28.000Z","dependencies_parsed_at":"2022-08-12T19:41:04.046Z","dependency_job_id":null,"html_url":"https://github.com/StudioSol/async","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/StudioSol%2Fasync","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/StudioSol%2Fasync/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/StudioSol%2Fasync/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/StudioSol%2Fasync/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/StudioSol","download_url":"https://codeload.github.com/StudioSol/async/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":221498712,"owners_count":16833053,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["async","go","hacktoberfest"],"created_at":"2024-07-30T20:01:32.487Z","updated_at":"2025-12-15T17:31:03.952Z","avatar_url":"https://github.com/StudioSol.png","language":"Go","readme":"## Async\n\n[![Build Status](https://travis-ci.org/StudioSol/async.svg?branch=master)](https://travis-ci.org/StudioSol/async)\n[![codecov](https://codecov.io/gh/StudioSol/async/branch/master/graph/badge.svg)](https://codecov.io/gh/StudioSol/async)\n[![Go Report Card](https://goreportcard.com/badge/github.com/StudioSol/async)](https://goreportcard.com/report/github.com/StudioSol/async)\n[![GoDoc](https://godoc.org/github.com/StudioSol/async?status.svg)](https://godoc.org/github.com/StudioSol/async)\n\nProvides a safe way to execute functions asynchronously, recovering them in case of panic. It also provides an error stack aiming to facilitate fail causes discovery, and a simple way to control execution flow without `WaitGroup`.\n\n### Usage\n```go\nvar (\n    user   User\n    songs  []Songs\n    photos []Photos\n)\n\nerr := async.Run(ctx,\n    func(ctx context.Context) error {\n        user, err = user.Get(ctx, id)\n        return err\n    },\n    func(ctx context.Context) error {\n        songs, err = song.GetByUserID(ctx, id)\n        return err\n    },\n    func(ctx context.Context) error {\n        photos, err = photo.GetByUserID(ctx, id)\n        return err\n    },\n)\n\nif err != nil {\n    log.Error(err)\n}\n```\n\nYou can also limit the number of asynchronous tasks\n\n```go\nrunner := async.NewRunner(tasks...).WithLimit(3)\nif err := runner.Run(ctx); err != nil { \n    log.Error(e)\n}\n```\n","funding_links":[],"categories":["Goroutines","Goroutines `goroutines的管理和使用`"],"sub_categories":["Search and Analytic Databases","Advanced Console UIs","检索及分析资料库","SQL 查询语句构建库"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstudiosol%2Fasync","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstudiosol%2Fasync","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstudiosol%2Fasync/lists"}