Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

请问下 saga 要怎么写呀 #74

Open
sllhSmile opened this issue Nov 20, 2023 · 5 comments
Open

请问下 saga 要怎么写呀 #74

sllhSmile opened this issue Nov 20, 2023 · 5 comments

Comments

@sllhSmile
Copy link

我看了示例
image
这样写是会报错的 因为 Saga 构造函数需要注入实例吧 ,image

@sllhSmile
Copy link
Author

Too few arguments to function DtmClient\Saga::__construct(), 0 passed in

@PandaLIU-1111
Copy link
Member

new Saga() 改成 make(Saga::class)

@sllhSmile
Copy link
Author

我现在是在laravel10 开启了octane swoole下运行, 没有单独的make 方法,
有试过app(Saga::class),

@PandaLIU-1111
Copy link
Member

https://github.com/dtm-php/dtm-laravel-sample/blob/master/app/Providers/DtmProvider.php#L53 可以参考一下这里的写法,注入一下,然后就可以使用 app(Saga::class) 的方式获取了

@sllhSmile
Copy link
Author

好的 我研究下, 目前来看就是 要自己包一个provider 来实现注入, 但是里面好多都用到了 Hyperf
包括我把对应的 项目拉下来 composer后 也会有 Hyperf\HttpServer\Contract\ResponseInterface 不存在的情况,

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants