You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

task.go 915 B

12345678910111213141516171819202122232425262728293031323334
  1. package task
  2. import (
  3. distsvc "gitlink.org.cn/cloudream/common/pkg/distlock/service"
  4. "gitlink.org.cn/cloudream/common/pkg/task"
  5. "gitlink.org.cn/cloudream/common/utils/ipfs"
  6. coorcli "gitlink.org.cn/cloudream/storage-common/pkgs/mq/client/coordinator"
  7. )
  8. type TaskContext struct {
  9. IPFS *ipfs.IPFS
  10. Coordinator *coorcli.Client
  11. DistLock *distsvc.Service
  12. }
  13. // 需要在Task结束后主动调用,completing函数将在Manager加锁期间被调用,
  14. // 因此适合进行执行结果的设置
  15. type CompleteFn = task.CompleteFn
  16. type Manager = task.Manager[TaskContext]
  17. type TaskBody = task.TaskBody[TaskContext]
  18. type Task = task.Task[TaskContext]
  19. type CompleteOption = task.CompleteOption
  20. func NewManager(ipfs *ipfs.IPFS, coorCli *coorcli.Client, distLock *distsvc.Service) Manager {
  21. return task.NewManager(TaskContext{
  22. IPFS: ipfs,
  23. Coordinator: coorCli,
  24. DistLock: distLock,
  25. })
  26. }

本项目旨在将云际存储公共基础设施化,使个人及企业可低门槛使用高效的云际存储服务(安装开箱即用云际存储客户端即可,无需关注其他组件的部署),同时支持用户灵活便捷定制云际存储的功能细节。