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

Add support for durable objects binding #2059

Closed
wants to merge 6 commits into from

Conversation

afranche
Copy link

@afranche afranche commented Nov 26, 2022

This PR addresses #1320 and follows upon the work done on cloudflare/cloudflare-go#949! 🙂

Closes #1320

@github-actions
Copy link

github-actions bot commented Nov 26, 2022

changelog detected ✅

@afranche afranche marked this pull request as ready for review November 26, 2022 02:34
Copy link
Member

@jacobbednarz jacobbednarz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks for starting this PR @afranche! unfortunately, we still have a bit of work to do here to get this over the line.

i have a feeling there may be more API calls involved here too as just testing this out on a dev account i have doesn't have DO working as smoothly as with wrangler.

@afranche
Copy link
Author

@jacobbednarz Thanks a lot for the review! 🙇🏼

we need to add the durable_object_binding to the worker script schema binding. right now, there is no way to configure/use the new functionality.

I'm unsure as to what the worker script schema binding is in this context. My thought process was given that the schema methods for Create, Read and Update all have a call to parseWorkerBindings, what had to be done to support DOs had to be done from there. If I understand correctly there is more to be done then ?

we'll need to fix the tests. right now, they don't pass as i suspect the durable object setup is going to be more involved (looking at https://developers.cloudflare.com/workers/learning/using-durable-objects/)

I see for the tests. Based on the link you sent I read that if we're using ES Modules, the main module has to be provided to the DO when creating it hence I'm wondering how well is it working if we're providing the DO without providing the main module with it, that might also be an issue! 😄

i have a feeling there may be more API calls involved here too as just testing this out on a dev account i have doesn't have DO working as smoothly as with wrangler.

I'd be happy knowing more details about how it worked if you may, and also what routine should be tested regarding how which cases we can stumble upon. 🙂

@jacobbednarz
Copy link
Member

for the missing schema, check out #2051. it is adding another binding type that should point you in the right direction.

as for what setup is involved for actual use and tests, I'm chasing down the internal team for clarification. if I can't get an answer in the next couple of days, I'll have to dissect wrangler and see what it is doing under the hood and hope the entire API is documented (or I'm just missing something completely)

@github-actions
Copy link

Marking this pull request as stale due to 14 days of inactivity. This helps our maintainers find and focus on the active pull requests. If this pull request receives no comments in the next 7 days it will automatically be closed. Maintainers can also remove the lifecycle/stale label.
If this pull request was automatically closed and you feel this pull request should be reopened, we encourage creating a new pull request linking back to this one for added context. Thank you!

@github-actions
Copy link

This PR was closed because it has been stalled for 7 days with no activity.

@github-actions github-actions bot closed this Dec 21, 2022
@davidfernandezm
Copy link

Hi all, what happened to this PR? I'm looking at deploying a worker with a Durable Object binding and this is not currently supported... is there any other way to use terraform to bind the Durable Object to the worker?

@afranche
Copy link
Author

@davidfernandezm Sorry for the late answer. I gave up on Terraform on the worker I was implementing the following for.

as for what setup is involved for actual use and tests, I'm chasing down the internal team for clarification. if I can't get an answer in the next couple of days, I'll have to dissect wrangler and see what it is doing under the hood and hope the entire API is documented (or I'm just missing something completely)

@jacobbednarz I don't know if you have found an answer regarding this, I'm willing to take back the work on this if you have some answers for me 😄

@skyf0l
Copy link

skyf0l commented Mar 8, 2024

We can just give up on durable objects and use wrangler as backup plan

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

Successfully merging this pull request may close these issues.

Durable objects?
4 participants