new Eventer(name, client, mspid)
Constructs a Eventer object
Parameters:
Name | Type | Description |
---|---|---|
name |
string | |
client |
Client | An instance of the Client class |
mspid |
Returns:
An instance of this class
- Type
- Eventer
Extends
Methods
-
<async> checkConnection( [reset])
-
Check the connection status
Parameters:
Name Type Argument Default Description reset
boolean <optional>
true Optional, attempt to reconnect if endpoint is not connected - Overrides:
-
<async> connect( [endpoint] [, options])
-
Connects this ServiceEndpoint with the given url and opts. If a connect exist an error will be thrown. The application must disconnect the connection before re-connecting to the service.
Parameters:
Name Type Argument Description endpoint
Endpoint <optional>
Service connection options including the url. When an endpoint is not provided, the setEndpoint() must have been called previously. If setEndpoint was previously call and a endpoint is provided here then it will replace the existing endpoint. options
ConnectionOptions <optional>
Any specific options for this instance of the connection to the peer. These will override options from the endpoint service connection options. Endpoint options and option provided here will replace options from the setEndpoint() if previously called. - Inherited From:
- Overrides:
-
disconnect()
-
Disconnects this Eventer from the fabric peer service and closes all services. The event listeners will be closed when EventService receives the "end" from the peer service.
- Overrides:
-
isConnectable()
-
Check that this ServiceEndpoint could be connected, even if it has failed a previous attempt.
- Inherited From:
- Overrides:
-
isTLS()
-
Determine whether or not this remote endpoint uses TLS.
- Inherited From:
- Overrides:
Throws:
-
if the Service Endpoint has not been connected to an endpoint.
- Type
- Error
Returns:
True if this endpoint uses TLS, false otherwise.- Type
- boolean
-
<async> resetConnection()
-
Reset the connection
- Inherited From:
- Overrides:
-
setEndpoint(endpoint, options)
-
Use this method to give this service endpoint an endpoint and options that it may connect to at a later time. Use the ServiceEndpoint#connect method without a endpoint or options to connect using the setting provided here.
Parameters:
Name Type Description endpoint
Endpoint Service connection options including the url. options
ConnectionOptions Any specific options for this instance of the connection to the peer. These will override options from the endpoint service connection options. - Inherited From:
- Overrides:
-
toString()
-
return a printable representation of this object
- Inherited From:
- Overrides: