Skip to content

asyncIterator support #5

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Closed
groundmuffin opened this issue Aug 7, 2017 · 6 comments
Closed

asyncIterator support #5

groundmuffin opened this issue Aug 7, 2017 · 6 comments

Comments

@groundmuffin
Copy link

groundmuffin commented Aug 7, 2017

Hi,
the new version of graphql-sibscription lib uses the special object with subscribe property, that returns asyncIterator object. Subscription Manager is deprecated. Do you have plans to add asyncIterator support?

@developerworks
Copy link
Contributor

developerworks commented Aug 13, 2017

@groundmuffin

graphql-rabbitmq-subscription

Just a workable fork. you can yarn add https://github.com/developerworks/graphql-rabbitmq-subscriptions.git.

There is a demo

@veeramarni
Copy link
Collaborator

@developerworks would you mind creating a PR?

@developerworks
Copy link
Contributor

developerworks commented Aug 14, 2017

@veeramarni

The fork repo have dist folder, just used for test with yarn add to install deps, i think it's not suitable for PR. i will make a new repo for PR in later.

@developerworks
Copy link
Contributor

Add AsyncIterator Support PR
@veeramarni
#8

@developerworks
Copy link
Contributor

developerworks commented Sep 9, 2017

logger issue:

TypeError: logger.child is not a function
1|gm-agent | at Object.createChildLogger (/home/www/servers/gm-agent-server/node_modules/graphql-rabbitmq-subscriptions/src/child-logger.ts:4:17)

var server = require("@cdm-logger/server");
var settings = {
  level: "info",
  mode: "short" // Optional: default 'short' ('short'|'long'|'dev'|'raw')
};
var cdmlogger = server.ConsoleLogger.create("pubsub", settings);
cdmlogger.level('trace')


export const pubsub = new AmqpPubSub({
  config: {
    host: config.RABBITMQ_HOST,
    port: config.RABBITMQ_PORT,
  },
  connectionListener: (err) => {
    if (err) {
      logger.error('connect to rabbitmq error ', err)
    } else {
      logger.info('connected to rabbitmq')
    }
  },
  logger: cdmlogger
})

create your own cdm logger to fix the error.

@veeramarni
Copy link
Collaborator

version 1.1.0 now supports asyniterator

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants