Skip to content

bmazaoreg/dnd_microservice

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 

Repository files navigation

dnd_microservice

  1. Requesting Data: Use the send_request function in your code to send requests to the microservice. The function takes two parameters: 'command', examples being edit_race, edit_background, and edit_class, and 'data', which the the data specific to each command. Example call: import zmq

Constants for ZeroMQ

SERVER_ENDPOINT = "tcp://127.0.0.1:5555"

def send_request(command, data): context = zmq.Context() socket = context.socket(zmq.REQ) socket.connect(SERVER_ENDPOINT)

request = {'command': command, **data}
socket.send_json(request)

response = socket.recv_json()
print("Response:", response)

if name == "main": send_request('edit_race', {'new_race': 'Elf'})

  1. Receiving Data: Data is automatically sent back to the client when the request is received. It is in the form of a JSON, containing the data with the edited fields.

  2. UML Diagram: image

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages