module Promiscuous::BlackHole

Public Class Methods

connect() click to toggle source
# File lib/promiscuous_black_hole.rb, line 25
def self.connect
  Promiscuous.ensure_connected
  Config.connect
end
ensure_embeddings_table() click to toggle source
# File lib/promiscuous_black_hole.rb, line 30
def self.ensure_embeddings_table
  DB.create_table?(:embeddings) do
    primary_key [:parent_table, :child_table], :name => :embeddings_pk
    column :parent_table, 'varchar(255)'
    column :child_table, 'varchar(255)'
  end
end
start() click to toggle source
# File lib/promiscuous_black_hole.rb, line 12
def self.start
  connect
  ensure_embeddings_table
  cli = Promiscuous::CLI.new
  cli.options = { :action => :subscribe }
  cli.run
end
subscribing_to?(collection) click to toggle source
# File lib/promiscuous_black_hole.rb, line 20
def self.subscribing_to?(collection)
  Config.subscriptions == :__all__ ||
    collection.to_sym.in?(Config.subscriptions)
end