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 907 B

12345678910111213141516171819202122232425262728293031323334
  1. package task
  2. import (
  3. distsvc "gitlink.org.cn/cloudream/common/pkgs/distlock/service"
  4. "gitlink.org.cn/cloudream/common/pkgs/task"
  5. "gitlink.org.cn/cloudream/common/utils/ipfs"
  6. coormq "gitlink.org.cn/cloudream/storage-common/pkgs/mq/coordinator"
  7. )
  8. type TaskContext struct {
  9. ipfs *ipfs.IPFS
  10. coordinator *coormq.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 *coormq.Client, distLock *distsvc.Service) Manager {
  21. return task.NewManager(TaskContext{
  22. ipfs: ipfs,
  23. coordinator: coorCli,
  24. distlock: distLock,
  25. })
  26. }

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