Uploaded image for project: 'C# Driver'
  1. C# Driver
  2. CSHARP-138

Add asynchronous APIs

    • Type: Icon: New Feature New Feature
    • Resolution: Duplicate
    • Priority: Icon: Critical - P2 Critical - P2
    • 2.0
    • Affects Version/s: None
    • Component/s: None
    • None
    • Minor Change

      C# 5.0 is all about making asynchronous programming a first class citizen of the language. Also, writing scalable server applications requires using only asynchronous I/O. This can only be done if the MongoDB driver exposes asynchronous operations for querying the database.

      In order to make it compatible with what C# 5.0 will be using, those APIs will need to use the task based pattern, and return Task<T>.
      For exemple,

      public MongoCursor<TDefaultDocument> Find(IMongoQuery query)

      would have an asynchronous equivalent:

      public Task<MongoCursor<TDefaultDocument>> FindAsync(IMongoQuery query)

      The resulting task represents a token for asynchronous completion of the operation.

      The driver exposes lots of I/O operations, but having the most used ones (Find, FindOne, Insert...) implemented first that way would go a long way.

            Assignee:
            craig.wilson@mongodb.com Craig Wilson
            Reporter:
            flavien Flavien
            Votes:
            77 Vote for this issue
            Watchers:
            66 Start watching this issue

              Created:
              Updated:
              Resolved: