Skip to content

Conversation

@CLopez021
Copy link
Collaborator

@CLopez021 CLopez021 commented Aug 2, 2022

Async Rpc Server Implementation

@zandershah zandershah changed the title Test Async Rpc Server Implementation Aug 3, 2022
@@ -0,0 +1,5 @@
{

Choose a reason for hiding this comment

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

We should ignore .vscode/*

-> pos_ref
-> Transport.Writer.t
-> Result.t<unit, Rpc_error.t>
<<<<<<< HEAD

Choose a reason for hiding this comment

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

There's a few merge conflicts here that we should resolve

>>>>>>> ec23e7a927aa331442e8fa83058b083345c54c1d
}

let real_function

Choose a reason for hiding this comment

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

Instead of [real_function] we should give it a name that explains what is happening


match result with
| Ok () -> ()
| Error _error ->

Choose a reason for hiding this comment

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

Instead of ignoring all of these results could we print them out so that theres some sort of logging on the server-side? Also we should add a comment about why these are being ignored (since they only fail when there's an issue with the connection in which case the connection will close automatically)

src/Server.fs Outdated
while true do
Console.WriteLine "Waiting for connection..."

task {

Choose a reason for hiding this comment

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

Why are some parts task and others async? Is this related to the task in nunit test but that we saw yesterday?

val close: t -> unit
val is_close_started: t -> bool
val set_close_finished_callback: t -> (Close_reason.t -> unit) -> unit
(*TODO is this the correct function to write the binary protocol?*)

Choose a reason for hiding this comment

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

Extra todo

@@ -0,0 +1,5 @@
{

Choose a reason for hiding this comment

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

Adding **/.vscode to the gitignore would also be good

<PackageReference Include="nunit" Version="3.13.2" />
<PackageReference Include="NUnit3TestAdapter" Version="4.0.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.0.0" />
<!--<PackageReference Include="xunit" Version="2.4.2" />

Choose a reason for hiding this comment

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

We can delete these now that we fixed the nunit confusion

(bin_reader_t (bin_a : _ Bin_prot.Type_class.t).reader)
}
end
(*TODO*)

Choose a reason for hiding this comment

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

Extra todos

Choose a reason for hiding this comment

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

Still 1 todo here

())

task {
Async_rpc.Connection.create

Choose a reason for hiding this comment

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

I think this is already wrapped in a task internally so we might not need this one?


())

let implementation_f = (fun _foo _bar -> ())

Choose a reason for hiding this comment

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

Why are we specifying a implementation for the client?

let start_server () =
let time = new Time_source.Wall_clock.t ()

let implementation_fun =

Choose a reason for hiding this comment

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

Lets use a more descriptive name - like wait_forever or sometihng


dispatch_tcs

let start_client port =

Choose a reason for hiding this comment

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

start_client_and_dispatch_query?


async {
let resp =
//could the string here be anything and it would work?

Choose a reason for hiding this comment

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

Extra comment

(bin_reader_t (bin_a : _ Bin_prot.Type_class.t).reader)
}
end
(*TODO*)

Choose a reason for hiding this comment

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

Still 1 todo here

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

Successfully merging this pull request may close these issues.

2 participants