Exemplo n.º 1
0
 def __call__(self, td):
     """Return matching ServerDescriptions from a TopologyDescription."""
     writable_servers = writable_server_selector(td)
     if writable_servers:
         return writable_servers
     else:
         return secondary_with_tags_server_selector(self.tag_sets, td)
Exemplo n.º 2
0
 def __call__(self, td):
     """Return matching ServerDescriptions from a TopologyDescription."""
     writable_servers = writable_server_selector(td)
     if writable_servers:
         return writable_servers
     else:
         return secondary_with_tags_server_selector(self.tag_sets, td)
Exemplo n.º 3
0
 def __call__(self, selection):
     """Apply this read preference to Selection."""
     if selection.primary:
         return selection.primary_selection
     else:
         return secondary_with_tags_server_selector(
             self.tag_sets,
             max_staleness_selectors.select(self.max_staleness, selection))
Exemplo n.º 4
0
 def __call__(self, server_descriptions):
     """Return matching ServerDescriptions from a list."""
     writable_servers = writable_server_selector(server_descriptions)
     if writable_servers:
         return writable_servers
     else:
         return secondary_with_tags_server_selector(self.tag_sets,
                                                    server_descriptions)
Exemplo n.º 5
0
 def __call__(self, server_descriptions):
     """Return matching ServerDescriptions from a list."""
     writable_servers = writable_server_selector(server_descriptions)
     if writable_servers:
         return writable_servers
     else:
         return secondary_with_tags_server_selector(
             self.tag_sets,
             server_descriptions)
Exemplo n.º 6
0
 def __call__(self, selection):
     """Apply this read preference to Selection."""
     if selection.primary:
         return selection.primary_selection
     else:
         return secondary_with_tags_server_selector(
             self.tag_sets,
             max_staleness_selectors.select(
                 self.max_staleness, selection))
Exemplo n.º 7
0
 def __call__(self, server_descriptions):
     """Return matching ServerDescriptions from a list."""
     return secondary_with_tags_server_selector(self.tag_sets,
                                                server_descriptions)
Exemplo n.º 8
0
 def __call__(self, server_descriptions):
     """Return matching ServerDescriptions from a list."""
     return secondary_with_tags_server_selector(
         self.tag_sets,
         server_descriptions)
Exemplo n.º 9
0
 def __call__(self, td):
     """Return matching ServerDescriptions from a TopologyDescription."""
     return secondary_with_tags_server_selector(self.tag_sets, td)
Exemplo n.º 10
0
 def __call__(self, td):
     """Return matching ServerDescriptions from a TopologyDescription."""
     return secondary_with_tags_server_selector(self.tag_sets, td)