-
Notifications
You must be signed in to change notification settings - Fork 7
Updated the file to use Lwt_stream.t in place of using Lwt_async+Lwt_mvar.t #10
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
base: main
Are you sure you want to change the base?
Conversation
rand00
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You are closer to the solution than before, but a bunch of more changes are required. Try to see how much you can solve from my comments and from the compiler complaining.
| .. (will be okay if not ordered, as Ring reorders) | ||
| *) | ||
| Lwt.async (fun () -> Lwt_mvar.put flow.sink ring_field); | ||
| Lwt_stream.push flow.sink ring_field; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is no such function. This is why I've said that the type alias type 'a stream = 'a Lwt_stream.t * ('a option -> unit) on line 164 is the type needed for the sink field.
| ) | ||
| end; | ||
| Lwt_mvar.take flow.sink >>= fun ring_field -> | ||
| Lwt_stream.get_available flow.sink >>= fun ring_field -> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This function returns an 'a list and not a 'a Lwt.t which is what I would use here. This is also what is needed to use the bind operator >>=. See if you can find the correct function to use here
| type partial_flow = { | ||
| is_client : bool; | ||
| sink : ring_field Lwt_mvar.t; | ||
| sink : ring_field Lwt_stream.t; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See my later comment concerning push, you are almost using the correct type, but not quite.
😭 Thank you..!! |
|
Hello @rand00, I will be a little late as I have exams this month, but I am working on it whenever I am free. |
Updated the file to use Lwt_stream.t in place of using Lwt_async+Lwt_mvar.t
fixes: #4
Signed-off-by: Prerna Dabi [email protected]
@rand00