Skip to content

Commit

Permalink
run nats server with jetstream
Browse files Browse the repository at this point in the history
  • Loading branch information
orsinium committed Jan 23, 2023
1 parent c5b2428 commit cbc7bb1
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 14 deletions.
13 changes: 6 additions & 7 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,20 +24,19 @@ jobs:

test:
runs-on: ubuntu-latest
services:
nats:
image: nats
options: "--jetstream"
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: "3.8"
- uses: arduino/setup-task@v1
- uses: onichandame/nats-action@master
with:
port: "4222"
- uses: onichandame/nats-client-action@master
with:
servers: "nats://localhost:4222"
cluster: "false"
- run: task test
env:
NATS_SERVER: nats://nats:4222

markdownlint-cli:
runs-on: ubuntu-latest
Expand Down
2 changes: 1 addition & 1 deletion .markdownlint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ MD007: # unordered list indentation
MD013: false # do not validate line length
MD014: false # allow $ before command output
MD029: # ordered list prefix
style: "ordered"
style: "one"
4 changes: 1 addition & 3 deletions walnats/_actors/_registry.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,14 @@

import nats

from .._constants import DEFAULT_SERVER
from ._connection import ConnectedActors


if TYPE_CHECKING:
from ._actor import Actor


DEFAULT_SERVER = 'nats://localhost:4222'


class Actors:
"""Registry of :class:`walnats.Actor` instances.
Expand Down
3 changes: 3 additions & 0 deletions walnats/_constants.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import os
from typing import Final

import nats.js
Expand All @@ -15,3 +16,5 @@
# Header for the timestamp until which the message has been delayed
# (in UTC, in seconds, as float).
HEADER_DELAY = 'Walnats-Delay'

DEFAULT_SERVER = os.environ.get('NATS_SERVER', 'nats://localhost:4222')
4 changes: 1 addition & 3 deletions walnats/_events/_registry.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,14 @@

import nats

from .._constants import DEFAULT_SERVER
from ._connection import ConnectedEvents


if TYPE_CHECKING:
from ._event import BaseEvent


DEFAULT_SERVER = 'nats://localhost:4222'


class Events:
"""Registry of :class:`walnats.Event` instances.
Expand Down

0 comments on commit cbc7bb1

Please sign in to comment.