GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — overloaded client.end · Issue #15 · brianc/node-postgres

overloaded client.end #15

New issue
Copy link
New issue
Copy link
Closed
Closed
overloaded client.end#15
Copy link
Labels
feature request

Description

@brianc
brianc
opened on Jan 28, 2011
Issue body actions

ability to pass true to client.end to have the method wait until the client's internal query queue is emptied before disconnection

client.query('alskdjf')
client.end() //disconnects before query is finished

versus

client.query('lkajsdf');
client.end(true) //disconnects once query is finished

Activity

  1. kaiko commented on Apr 10, 2011

    @kaiko
    kaiko
    on Apr 10, 2011
    More actions

    I created this (for me, callback was really needed because other modules closing was depending on database finish):

    PGClient.prototype.safeEnd = function (callback) {
        var me = this, realEnd = function () { me.end(); callback(); }
    
        if (this.readyForQuery && this.queryQueue.length === 0) realEnd();
        else this.on('drain', realEnd);
    }
    
  2. brianc commented on Sep 2, 2011

    @brianc
    brianc
    on Sep 2, 2011
    OwnerAuthor
    More actions

    now calling pg.end on the connection pool will wait until all pending queries are finished in each client before terminating each client. I think having the client object itself's 'end' method do an immediate shutdown is consistent with the rest of node's APIs.

  3. brianc
    closed this as completedon Sep 2, 2011
  4. brianc
    added 2 commits that reference this issue on Dec 20, 2019

    Merge pull request #15 from slickmb/bug/close_race

    ca21462

    Fix error event doc in README (#15)

    ce173f8
  5. brianc
    added a commit that references this issue on Apr 28, 2020

    Update coveralls badge

    This issue will close once commit c9ee9cd is merged into the 'master' branch.
    c9ee9cd
  6. krishna-yb
    added a commit that references this issue on Nov 20, 2025

    Set sequelize port to 8080 (yugabyte#15)

    ac3d1cf
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    feature request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402775 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.