---
name: "Message::Passing::Role::HasAConnection"
section: "3pm"
platform: "linux"
package: "libmessage-passing-perl"
version: "0.117-1"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/Message::Passing::Role::HasAConnection"
---

# Message::Passing::Role::HasAConnection(3pm)

Role for components which have a connection

## NAME

Message::Passing::Role::HasAConnection - Role for components which have a connection

## DESCRIPTION

Provides a standard -\>connection\_manager attribute for inputs or outputs which need to make a network connection before they can send or receive messages.

The connection manager object is assumed to have the `"->subscribe_to_connect"` method (from Message::Passing::Role::Connection).

## REQUIRED METHODS

### \_build\_connection\_manager

Will be called at BUILD (i.e. object construction) time, should return a connection manager object (i.e. an object that `"->subscribe_to_connect"` can be called on).

### connected ($client)

Called by the connection manager when a connection is made.

Usually used to do things like subscribe to queues..

## OPTIONAL METHODS

### disconnected ($client)

The client received an error or otherwise disconnected.

## ATTRIBUTES

### connection\_manager

Holds the connection manger returned by the `"_build_connection_manager"` method.

## WRAPPED METHODS

### BUILD

Is wrapped to build the connection manager object.

## SEE ALSO

- Message::Passing::Role::ConenctionManager.

  ## SPONSORSHIP

This module exists due to the wonderful people at Suretec Systems Ltd. \<http://www.suretecsystems.com/\> who sponsored its development for its VoIP division called SureVoIP \<http://www.surevoip.co.uk/\> for use with the SureVoIP API -  \<http://www.surevoip.co.uk/support/wiki/api\_documentation\>

## AUTHOR, COPYRIGHT AND LICENSE

See Message::Passing.
