Giter Site home page Giter Site logo

Comments (10)

ovatsus avatar ovatsus commented on August 23, 2024

Actually XxxAsync usually means that a Task is returned, the convention for F# async is AsyncXxx

from fsharp.data.sqlclient.

dmitry-a-morozov avatar dmitry-a-morozov commented on August 23, 2024

Robert,
I followed same guidelines as (slides # 15-16)
http://view.officeapps.live.com/op/view.aspx?src=http%3a%2f%2fvideo.ch9.ms%2fsessions%2fbuild%2f2013%2f3-301.pptx
Video
http://channel9.msdn.com/Events/Build/2013/3-301#time=55m40s
Async prefix/post-fix is legacy from old days where there were 2 versions of method. Type system is expressive enough for user to figure out that return type is async computation.

from fsharp.data.sqlclient.

rojepp avatar rojepp commented on August 23, 2024

@ovatsus Completely correct, sorry.
@dmitry-a-morozov I've had that same notion, thinking always provide async only. Now, being exposed to it, it is pretty annoying, and I quickly changed my opinion. :)
Often you don't care about async. In the app I tried this TP on, I'm processing up to 95.000 mappings from street address to lat/lon coordinates every day. This is a simple console app, and Async is completely irrelevant here. Getting back an async in this case just distracts; 'now what do I do with this?'

from fsharp.data.sqlclient.

dmitry-a-morozov avatar dmitry-a-morozov commented on August 23, 2024

Robert,
Are you on F# 3.1?

from fsharp.data.sqlclient.

rojepp avatar rojepp commented on August 23, 2024

No, still 3.0. Why?

from fsharp.data.sqlclient.

dmitry-a-morozov avatar dmitry-a-morozov commented on August 23, 2024

You can write generic extension method that does sync execution.
But you need 3.1 for it to make sense otherwise it won't look anyhow better than Async.RunSynchronously
Follow me?

from fsharp.data.sqlclient.

rojepp avatar rojepp commented on August 23, 2024

You mean because type annotations are no longer necessary for extension methods? Pretty obscure to me, will not make anything look better. But I feel the resistance. I'm fine with closing the issue.

from fsharp.data.sqlclient.

dmitry-a-morozov avatar dmitry-a-morozov commented on August 23, 2024

Because you can combine extension method and inline constrains.
I'll send you example later (once I'll install VS 2013)
Don't close it yet. I want think about it.

from fsharp.data.sqlclient.

dmitry-a-morozov avatar dmitry-a-morozov commented on August 23, 2024

@ovatsus What's you take on this async/sync issue?

  1. Keep only one async Execute
  2. Have 2 methods AsyncExecute & Execute
  3. Add helper module method: let inline SqlCommand.execute = cmd.Execute() |> Async.RunSynchronously

from fsharp.data.sqlclient.

ovatsus avatar ovatsus commented on August 23, 2024

I'd say 2)


From: Dmitry
Sent: 18/10/2013 19:12
To: dmitry-a-morozov/FSharp.Data.SqlCommandTypeProvider
Cc: Gustavo Guerra
Subject: Re: [FSharp.Data.SqlCommandTypeProvider] Provide Synchronous Execute() (#5)

@ovatsus What's you take on this async/sync issue?

  1. Keep only one async Execute
  2. Have 2 methods AsyncExecute & Execute
  3. Add helper module method: let inline SqlCommand.execute = cmd.Execute() |> Async.RunSynchronously

Reply to this email directly or view it on GitHub:
#5 (comment)

from fsharp.data.sqlclient.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.