Sending objects through messaging between gatways

Is it possible to send a python class object in a dictionary to a remote gateway.

system.util.sendMessage(
project = 'someProject',
messageHandler = 'test',
payload = {'AbstractClass': shared.test.AbstractClass()},
scope = 'G',
remoteServers = remoteServers)

and on the destination gateway message handler

def handleMessage(payload):
payload['AbstractClass'].run()

Is there a better way to distribute code execution among several gateways while maintaining the code in the EAM gateway?

No, python code is not serializable to travel through a network packet, nor is there any way to ensure everything that could get called would be included.

Distribute just the code in projects. Perhaps a dedicated project.

Run the code with indirection, something like this:

You message payload and return payload do have to be serialiazable.