Skip to content

Commit

Permalink
[doc] add dsn_to_context usage example
Browse files Browse the repository at this point in the history
  • Loading branch information
makasim committed Sep 25, 2017
1 parent 2673504 commit 387b1da
Show file tree
Hide file tree
Showing 12 changed files with 43 additions and 3 deletions.
5 changes: 4 additions & 1 deletion docs/transport/amqp.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ $connectionFactory = new AmqpConnectionFactory();

// same as above
$factory = new AmqpConnectionFactory('amqp:');
$factory = new AmqpConnectionFactory('amqp+ext:');

// same as above
$factory = new AmqpConnectionFactory([]);
Expand All @@ -52,6 +51,10 @@ $factory = new AmqpConnectionFactory([
$factory = new AmqpConnectionFactory('amqp://user:[email protected]:10000/%2f');

$psrContext = $factory->createContext();

// if you have enqueue/enqueue library installed you can use a function from there to create the context
$psrContext = \Enqueue\dsn_to_context('amqp:');
$psrContext = \Enqueue\dsn_to_context('amqp+ext:');
```

## Declare topic.
Expand Down
5 changes: 4 additions & 1 deletion docs/transport/amqp_bunny.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ $factory = new AmqpConnectionFactory();

// same as above
$factory = new AmqpConnectionFactory('amqp:');
$factory = new AmqpConnectionFactory('amqp+bunny:');

// same as above
$factory = new AmqpConnectionFactory([]);
Expand All @@ -52,6 +51,10 @@ $factory = new AmqpConnectionFactory([
$factory = new AmqpConnectionFactory('amqp://user:[email protected]:10000/%2f');

$psrContext = $factory->createContext();

// if you have enqueue/enqueue library installed you can use a function from there to create the context
$psrContext = \Enqueue\dsn_to_context('amqp:');
$psrContext = \Enqueue\dsn_to_context('amqp+bunny:');
```

## Declare topic.
Expand Down
5 changes: 4 additions & 1 deletion docs/transport/amqp_lib.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ $factory = new AmqpConnectionFactory();

// same as above
$factory = new AmqpConnectionFactory('amqp:');
$factory = new AmqpConnectionFactory('amqp+lib:');

// same as above
$factory = new AmqpConnectionFactory([]);
Expand All @@ -52,6 +51,10 @@ $factory = new AmqpConnectionFactory([
$factory = new AmqpConnectionFactory('amqp://user:[email protected]:10000/%2f');

$psrContext = $factory->createContext();

// if you have enqueue/enqueue library installed you can use a function from there to create the context
$psrContext = \Enqueue\dsn_to_context('amqp:');
$psrContext = \Enqueue\dsn_to_context('amqp+lib:');
```

## Declare topic.
Expand Down
3 changes: 3 additions & 0 deletions docs/transport/dbal.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,9 @@ $factory = new ManagerRegistryConnectionFactory($registry, [
]);

$psrContext = $factory->createContext();

// if you have enqueue/enqueue library installed you can use a function from there to create the context
$psrContext = \Enqueue\dsn_to_context('mysql:');
```

## Init database
Expand Down
3 changes: 3 additions & 0 deletions docs/transport/filesystem.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,9 @@ $connectionFactory = new FsConnectionFactory([
]);

$psrContext = $connectionFactory->createContext();

// if you have enqueue/enqueue library installed you can use a function from there to create the context
$psrContext = \Enqueue\dsn_to_context('file:');
```

## Send message to topic
Expand Down
5 changes: 5 additions & 0 deletions docs/transport/gearman.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,11 @@ $factory = new GearmanConnectionFactory([
'host' => 'example',
'port' => 5555
]);

$psrContext = $factory->createContext();

// if you have enqueue/enqueue library installed you can use a function from there to create the context
$psrContext = \Enqueue\dsn_to_context('gearman:');
```

## Send message to topic
Expand Down
3 changes: 3 additions & 0 deletions docs/transport/gps.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@ $connectionFactory = new GpsConnectionFactory();
$connectionFactory = new GpsConnectionFactory('gps:');

$psrContext = $connectionFactory->createContext();

// if you have enqueue/enqueue library installed you can use a function from there to create the context
$psrContext = \Enqueue\dsn_to_context('gps:');
```

## Send message to topic
Expand Down
3 changes: 3 additions & 0 deletions docs/transport/kafka.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,9 @@ $connectionFactory = new RdKafkaConnectionFactory([
]);

$psrContext = $connectionFactory->createContext();

// if you have enqueue/enqueue library installed you can use a function from there to create the context
$psrContext = \Enqueue\dsn_to_context('kafka:');
```

## Send message to topic
Expand Down
5 changes: 5 additions & 0 deletions docs/transport/pheanstalk.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,11 @@ $factory = new PheanstalkConnectionFactory([
'host' => 'example',
'port' => 5555
]);

$psrContext = $factory->createContext();

// if you have enqueue/enqueue library installed you can use a function from there to create the context
$psrContext = \Enqueue\dsn_to_context('beanstalk:');
```

## Send message to topic
Expand Down
3 changes: 3 additions & 0 deletions docs/transport/redis.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,9 @@ $factory = new RedisConnectionFactory([
$factory = new RedisConnectionFactory('redis://example.com:1000?vendor=phpredis');

$psrContext = $factory->createContext();

// if you have enqueue/enqueue library installed you can use a function from there to create the context
$psrContext = \Enqueue\dsn_to_context('redis:');
```

* With predis library:
Expand Down
3 changes: 3 additions & 0 deletions docs/transport/sqs.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@ $factory = new SqsConnectionFactory([
$factory = new SqsConnectionFactory('sqs:?key=aKey&secret=aSecret&region=aRegion');

$psrContext = $factory->createContext();

// if you have enqueue/enqueue library installed you can use a function from there to create the context
$psrContext = \Enqueue\dsn_to_context('sqs:');
```

## Declare queue.
Expand Down
3 changes: 3 additions & 0 deletions docs/transport/stomp.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@ $factory = new StompConnectionFactory([
$factory = new StompConnectionFactory('stomp://example.com:1000?login=theLogin');

$psrContext = $factory->createContext();

// if you have enqueue/enqueue library installed you can use a function from there to create the context
$psrContext = \Enqueue\dsn_to_context('stomp:');
```

## Send message to topic
Expand Down

0 comments on commit 387b1da

Please sign in to comment.