📜
En2Do
  • En2Do
  • Get Started
    • Add as dependency
    • Create the MongoManager
      • MongoManager and ExecutorService
    • Create an Entity
      • Entities without lombok
    • Create the Repository
    • Packing all together
  • METHODS
    • Predefined methods
    • Method keywords
    • Filter keywords
    • AsyncRepository
  • Repository Options
    • What are Repository Options?
    • SeparateEntityId
    • DropEntitiesOnStart
    • DropIndexesOnStart
    • AppendMethodAsComment
  • Usage
    • Sorting
      • Sorting by Annotation
      • Sorting by Parameter
    • Pagination
    • Index
      • Identifier Index
      • Compound Index (Multi-Field-Index)
      • TTL Index
    • Transform
    • Transient
    • TransformField
    • Async
    • UpdateBatch
Powered by GitBook
On this page
  1. Get Started
  2. Create the MongoManager

MongoManager and ExecutorService

PreviousCreate the MongoManagerNextCreate an Entity

Last updated 2 years ago

CtrlK

Since there is also an AsyncRepository and asynchronous methods that return CompletableFuture, the MongoManager can also be passed its own ExecutorService that is responsible for executing the CompletableFuture.

Example of MongoManager with ExecutorService:

public class Application {

    public static void main(String[] args) {
        MongoManager manager = new MongoManager(
                    Credentials.of("yourConnectString", "yourDatabase"), 
                    Executors.newSingleThreadExecutor()
            );
    }
}