I have a serializer, in that I've overridden the validate method.
class ProcessItemSerializer(serializers.Serializer):
field1 = serializers.CharField(max_length=63)
# Few more fields
def validate(self, data):
# few data processing and HTTP calls
return data
I have another serializer which use above serializer as many=True field
class DataSerializer(serializers.Serializer):
items = ProcessItemSerializer(many=True)
If I pass a list of item data to DataSerializer it will process one by one each item. thats desirable!
but if length of items is more than 100 it takes much time. what I want is to execute set of 20-20 items parallel using python-multiprocess so that I can reduce the overall time.
how can I do this in DRF. what method do I have to override?