Sha256: 111a16356bab03a2c81afa93260c947c217ee2eb30deeb9745f904dab0868e83

Contents?: true

Size: 720 Bytes

Versions: 16

Compression:

Stored size: 720 Bytes

Contents

CREATE OR REPLACE FUNCTION message_store.acquire_lock(
  stream_name varchar
)
RETURNS bigint
AS $$
DECLARE
  _category varchar;
  _category_name_hash bigint;
BEGIN
  _category := category(acquire_lock.stream_name);
  _category_name_hash := hash_64(_category);
  PERFORM pg_advisory_xact_lock(_category_name_hash);

  IF current_setting('message_store.debug_write', true) = 'on' OR current_setting('message_store.debug', true) = 'on' THEN
    RAISE NOTICE 'ยป acquire_lock';
    RAISE NOTICE 'stream_name: %', acquire_lock.stream_name;
    RAISE NOTICE '_category: %', _category;
    RAISE NOTICE '_category_name_hash: %', _category_name_hash;
  END IF;

  RETURN _category_name_hash;
END;
$$ LANGUAGE plpgsql
VOLATILE;

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
message-db-3.0.0 database/functions/acquire-lock.sql
message-db-2.1.6 database/functions/acquire-lock.sql
message-db-2.1.5 database/functions/acquire-lock.sql
message-db-2.1.4 database/functions/acquire-lock.sql
message-db-2.1.3 database/functions/acquire-lock.sql
message-db-2.1.2 database/functions/acquire-lock.sql
message-db-2.1.1 database/functions/acquire-lock.sql
message-db-2.1.0 database/functions/acquire-lock.sql
message-db-2.0.2 database/functions/acquire-lock.sql
message-db-2.0.1 database/functions/acquire-lock.sql
message-db-2.0.0 database/functions/acquire-lock.sql
message-db-1.1.3 database/functions/acquire-lock.sql
message-db-1.1.2 database/functions/acquire-lock.sql
message-db-1.1.1 database/functions/acquire-lock.sql
message-db-1.1.0 database/functions/acquire-lock.sql
message-db-1.0.0 database/functions/acquire-lock.sql